Cachearium 是一个用于 PHP 应用的高级缓存框架。
示例代码:
$Data = 'xxxx'; // sTore $cache = CacheAbsTract::factory('your backend'); $cache->store($data, new CacheKey('NamespACE', 'Subname')); // get it later try { $data2 = $cache->get(new CacheKey('Namespace', 'Subname')); // $data2 == 'xxxx'; } catch (NotCachedException($e)) { // handle not cached } // store new value with automatic inValidation $data = 'YYy'; $cache->store($data, new CacheKey('Namespace', 'Subname'));