isLocked()); if ($this->isLocked()) { // 5 seconds passed, assume the owning process died off and remove it $this->removeLock($key); } } public function get($key, $expiration = false) { if (! $expiration) { // default to global cache time $expiration = Config::Get('cache_time'); } if (($ret = @apc_fetch($key)) === false) { return false; } if (time() - $ret['time'] > $expiration) { $this->delete($key); return false; } return unserialize($ret['data']); } public function set($key, $value) { // we store it with the cache_time default expiration so objects will atleast get cleaned eventually. if (@apc_store($key, array('time' => time(), 'data' => serialize($value)), Config::Get('cache_time')) == false) { throw new CacheException("Couldn't store data in cache"); } } public function delete($key) { @apc_delete($key); } }