File: example.php

Recommend this page to a friend!
  Classes of Eugene Panin  >  ObjectCache  >  example.php  >  Download  
File: example.php
Role: ???
Content type: text/plain
Description: Usage example
Class: ObjectCache
Author: By
Last change:
Date: 19 years ago
Size: 472 bytes
 

Contents

Class file image Download
<?
require 'CacheLib.php';
class TestClass {
	var $name;
	
	function TestClass($val=null) {
		if ($val) $this->name = $val;
	}
	
	function getName() {
		return $this->name;
	}
	
	function setNAme($val) {
		$this->name = $val;
	}
}

$obj1 = new TestClass('test1');
$obj2 = new TestClass('test2');
$cache = new ObjectCache;
$cache->add('obj1key',&$obj1);
$cache->add('obj2key',&$obj2);
$obj3 =& $cache->find('obj1key');
$cache->remove('obj2key');
?>

For more information send a message to info at phpclasses dot org.