[+] Classes: add local cache system

This commit is contained in:
rMalie
2011-11-29 09:55:21 +00:00
parent 727b540ce2
commit cf7301884c
3 changed files with 35 additions and 14 deletions
+25
View File
@@ -70,6 +70,11 @@ abstract class CacheCore
'page_viewed',
);
/**
* @var array Store local cache
*/
protected static $local = array();
/**
* Cache a data
*
@@ -291,4 +296,24 @@ abstract class CacheCore
return true;
return false;
}
public static function store($key, $value)
{
Cache::$local[$key] = $value;
}
public static function retrieve($key)
{
return isset(Cache::$local[$key]) ? Cache::$local[$key] : null;
}
public static function isStored($key)
{
return isset(Cache::$local[$key]);
}
public static function clean($key)
{
unset(Cache::$local[$key]);
}
}