Recommend this page to a friend! | Stumble It! | Bookmark in del.icio.us |
Classes of Eugene Panin | > | ObjectCache | > | example.php | > | Download | ||
|
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'); ?> |