[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Cache/ -> Function.php (sommaire)

(pas de description)

Poids: 158 lignes (5 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 1 fichier
 Cache.php

Définit 1 class

Cache_Function:: (3 méthodes):
  Cache_Function()
  _Cache_Function()
  call()


Classe: Cache_Function  - X-Ref

Function_Cache

Purpose:

Caching the result and output of functions.

Example:

require_once 'Cache/Function.php';

class foo {
function bar($test) {
echo "foo::bar($test)<br>";
}
}

class bar {
function foobar($object) {
echo '$'.$object.'->foobar('.$object.')<br>';
}
}

$bar = new bar;

function foobar() {
echo 'foobar()';
}

$cache = new Cache_Function();

$cache->call('foo::bar', 'test');
$cache->call('bar->foobar', 'bar');
$cache->call('foobar');

Note:

You cannot cache every function. You should only cache
functions that only depend on their arguments and don't use
global or static variables, don't rely on database queries or
files, and so on.

Cache_Function($container = 'file',$container_options = array('cache_dir' => '.','filename_prefix' => 'cache_')   X-Ref
Constructor

param: string  Name of container class
param: array   Array with container class options
param: integer Number of seconds for which to cache

_Cache_Function()   X-Ref
PEAR-Deconstructor
Call deconstructor of parent


call()   X-Ref
Calls a cacheable function or method.

return: mixed $result



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7