PHP高级缓存系统:Cachearium

jopen 9年前

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'));

项目主页:http://www.open-open.com/lib/view/home/1431394929966