[+] 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:
rMalie
2011-11-29 09:55:21 +00:00
parent 9ca2fe4ca5
commit 2cba5f3e1a
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]);
}
}