[+] Classes: add local cache system
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10729 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
Vendored
+25
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user