Class \Prado\I18N\core\TCache_Lite
TCache_Lite is a fast, light and safe cache system. It's optimized for file containers. It is fast and safe (because it uses file locking and/or anti-corruption tests).
There are some examples in the 'docs/examples' file Technical choices are described in the 'docs/technical' file
A tutorial is available in english at this url : http://www.pearfr.org/index.php/en/article/cache_lite (big thanks to Pierre-Alain Joye for the translation)
The same tutorial is also available in french at this url : http://www.pearfr.org/index.php/fr/article/cache_lite
Memory Caching is from an original idea of Mike BENOIT ipso@snappymail.ca
Class hierarchy
Author: Fabien MARTY <fab@php.net>
public
|
__construct([array<string|int, mixed> $options = [null] ]) : mixed
Constructor
$options is an assoc. Available options are : $options = array( 'cacheDir' => directory where to put the cache files (string), 'caching' => enable / disable caching (boolean), 'lifeTime' => cache lifetime in seconds (int), 'fileLocking' => enable / disable fileLocking (boolean), 'writeControl' => enable / disable write control (boolean), 'readControl' => enable / disable read control (boolean), 'readControlType' => type of read control 'crc32', 'md5', 'strlen', 'memoryCaching' => enable / disable memory caching (boolean), 'onlyMemoryCaching' => enable / disable only memory caching (boolean), 'memoryCachingLimit' => max nbr of records in memory caching (int), 'fileNameProtection' => enable / disable file name protection (boolean), 'automaticSerialization' => enable / disable serialization (boolean) ); |
public
|
|
public
|
clean([false|string $group = false ]) : bool
Clean the cache
if no group is specified all cache files will be destroyed else only cache files of the specified group will be destroyed |
public
|
get(string $id[, string $group = 'default' ][, bool $doNotTestCacheValidity = false ]) : string
Test if a cache is available and (if yes) return it
|
public
|
|
public
|
|
public
|
save(string $data[, string $id = null ][, string $group = 'default' ]) : bool
Save some data in a cache file
|
public
|
|
protected
|
_hash(string $data, string $controlType) : string
Make a control key with the string containing datas
|
protected
|
|
protected
|
|
protected
|
|
protected
|
_writeAndControl(string $data) : bool
Write the given data in the cache file and control it just after to avoid
corrupted cache entries
|
|