function testDrivers() { $drivers = glob("../lib/plugin/Cache/*.php"); foreach ($drivers as $drive) { if (substr($drive, -9) == 'Cache.php') { continue; } require $drive; if (!ActiveMongo_Cache::isDriverActived()) { continue; } ActiveMongo_Cache::flushCache(); CacheableModel::drop(); $id = $this->testCacheSimple(); $vars = $this->testCacheMultiple(); $this->testUpdateCache($id); $this->testFetchFromCache($id); $this->testUpdateQueryCache($vars); } }
/** * Initialize the Cache system, this is done * automatically. * * @return void */ public static function Init() { if (self::$instance) { return; } self::$instance = new ActiveMongo_Cache(); }
$object[$k] = FALSE; } return TRUE; } function setMulti(array $objects, array $ttl) { $this->memcached->setMulti($objects); } function get($key, &$object) { $object = $this->memcached->get($key); if (!$object) { if ($this->memcached->getResultCode() == Memcached::RES_NOTFOUND) { return FALSE; } } return TRUE; } function set($key, $object, $ttl) { $this->memcached->set($key, $object, $ttl); } function delete(array $keys) { foreach ($keys as $key) { $this->memcached->delete($key); } } } ActiveMongo_Cache::setDriver(new MemcachedDriver());