Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2001-10-02 06:29
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');
?>