tdt/cache

缓存系统的包装器。

v1.0 2013-02-06 19:46 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:20:10 UTC


README

Build Status

此存储库包含一个缓存系统的包装器。如果您没有安装缓存系统,可以使用NoCache,或者MemCache。这允许用户在其代码中提供缓存,并在必要时切换到其他缓存系统。

用法

$c = Cache::getInstance( array("system" => "Memcache", "host" => "localhost", "port" => 11211 ) );
$c->set("key", $objectToCache, $TTL); // TTL is optional

$cachedObject = $c->get("key");
// delete the cachedObject
$c->delete("key");