Categories
PHP

fileCache – Updated to v1.0

fileCache it’s been improved 😉

The latest version of the class chooses which is the best option of storage engine, based on the size of the variable. Then for example an entire page HTML will be in a single file, and a number or a person name would be in the APP cache.

Usage:

$cache = fileCache::GetInstance(30,'cache/');//creating new instance singleton

$cache->setDebug(true);//this runs the debug and in destruct prints it

//normal usage
$cache->cache('test','test values for the var!!!!');
echo $cache->cache('test');//get

//overloads
$cache->anyvar='tes asd asd aasdasdasda sada ast';//overload of set and get methods
echo $cache->anyvar;//get overload
var_dump(isset($cache->anyvar));//isset and unset are overloaded
unset($cache->anyvar);

//clear
$cache->deleteCache();//deletes all the cache
$cache->deleteCache(60);//deletes any cache older than X seconds

Download