APC singleton pattern
2010-1-06 19:52
This time small class for APC singleton pattern.
class CSCache {
static private $m_objMem = NULL;
function __construct(){
}
static function getMem() {
if (self::$m_objMem == NULL) {
self::$m_objMem = new CSCache();
}
return self::$m_objMem;
}
function delete($key) {
apc_delete($key);
}
function restore($key) {
return apc_fetch($key);
}
function store($key, $value, $ttl = 12000) {
apc_store($key,$value,$ttl);
}
}
Back »
Comments: 0
Leave a reply »