<?php
// Since Cache_Lite-1.7.0beta2
require_once('Cache/Lite/Function.php');
$options = array(
'cacheDir' => '/tmp/',
'lifeTime' => 3600
);
$obj = new foo($options);
class foo
{
var $test;
function foo($options)
{
$cache = new Cache_Lite_Function($options);
$this->test = 'foobar';
$cache->call(array(&$this, 'method_bar'), 12, 45);
}
function method_bar($arg1, $arg2)
{
echo "\$this->test = $this->test and this is the output of the method \$this->method_bar($arg1, $arg2) !<br>";
return "\$this->test = $this->test and this is the result of the method \$this->method_bar($arg1, $arg2) !<br>";
}
}
?> |