|
zCaheBaseThis is the base class of zoglair cache managers. It defines all methods required so that switching among cache plugins is transparent. A descendant needs to override save() and load(). Their default definitions are to save and load items from memory, respectively. A descendant of this class is instantiated as the globally available $zCahe object, based on the relevant system setting. The following code snippet demonstrates how $zCahe is meant to be used:
global $zCahe; $t2l = zCaheBase::Z_FOREVER; $hash = $zCahe->hash('myData', $t2l); $DATA = $zCahe->load($hash, $t2l); if (!$DATA) { ; // create $DATA $zCahe->save($hash, $t2l, $DATA); }
integer get_max_hash_len()static ⇧ Returns the maximum length a hash() return value can have. This is currently 71 bytes.
string hash(mixed $name, mixed $t2l, mixed $args='')static ⇧ Generates a hash (~key) used by cache plugins to save/load data. The generated hash qualifies as an array key, filename or column value.
mixed load(string $hash, mixed $t2l) ⇧ Loads data from cache, previously stored via save().
void save(string $hash, mixed $t2l, mixed $data) ⇧ Saves data to cache, retreivable via load().
|