public function add($key, $value, $timeOut = 0) { if (\xcache_isset($key)) { return false; } return \xcache_set($key, $value, $timeOut); }
/** * Gets a value from the variable store * @param string $key The key of the variable * @param mixed $default The default value for when the key is not set * @return mixed The value of the variable if it exists, the provided default value otherwise */ public function get($key, $default = null) { if (xcache_isset($key)) { return xcache_get($key); } return $default; }
public function delete($id, $tag = FALSE) { if ($tag !== FALSE) { Kohana::log('error', 'Cache: tags are unsupported by the Xcache driver'); return TRUE; } elseif ($id !== TRUE) { if (xcache_isset($id)) { return xcache_unset($id); } return FALSE; } else { // Do the login $this->auth(); $result = TRUE; for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++) { if (xcache_clear_cache(XC_TYPE_VAR, $i) !== NULL) { $result = FALSE; break; } } // Undo the login $this->auth(TRUE); return $result; } return TRUE; }
/** * @param string $key * @return boolean */ public function delete($key) { if (!xcache_isset($key)) { return TRUE; } return xcache_unset($key); }
function cacheget($name) { if (!$this->cache_type) { return; } $rdata2 = false; if (!$this->thestorage) { switch ($this->cache_type) { case 1: if ($this->connect()) { $rdata = $this->mchandle->get(VBSEO_CACHE_VAR); } break; case 2: $rdata = apc_fetch(VBSEO_CACHE_VAR); break; case 3: if (xcache_isset(VBSEO_CACHE_VAR)) { $rdata = xcache_get(VBSEO_CACHE_VAR); } break; case 4: $rdata = eaccelerator_get(VBSEO_CACHE_VAR); break; } if ($rdata) { $this->thestorage = unserialize($rdata); } else { $this->thestorage = array(); } } $rdata2 = $this->thestorage[$name]; return $rdata2; }
/** * Retrieve an item from the cache. * * @param string The name of the cache * @param boolean True if we should do a hard refresh * @return mixed Cache data if successful, false if failure */ function fetch($name, $hard_refresh = false) { if (!xcache_isset($this->unique_id . "_" . $name)) { return false; } return xcache_get($this->unique_id . "_" . $name); }
public function __isset($index) { if (function_exists('xcache_isset')) { return xcache_isset($index); } return false; }
/** * Read a key from the cache * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ function read($key) { if (xcache_isset($key)) { return xcache_get($key); } return false; }
/** * 读取缓存,失败或缓存撒失效时返回 false * * @param string $id * * @return mixed */ function get($id) { if (xcache_isset($id)) { return xcache_get($id); } return false; }
/** * {@inheritdoc} */ public function expired($key, $mins) { $key = $this->getName($key); if (xcache_isset($key)) { return time() - xcache_get($key)['created'] > $mins * 60; } }
public function get($key) { if (!$key) { return false; } return xcache_isset($key) ? xcache_get($key) : false; }
public function get($id) { if (xcache_isset($id)) { return xcache_get($id); } return NULL; }
/** * {@inheritdoc} */ public function add($key, $value, $ttl = 0) { if (!xcache_isset($key)) { return xcache_set($key, $value, $ttl); } return false; }
/** * Delete cache from shared memory * * @param string $sKey - file name * @return result of the operation */ function delData($sKey) { if (!xcache_isset($sKey)) { return true; } return xcache_unset($sKey); }
/** * 读取缓存 * @access public * @param string $name 缓存变量名 * @return mixed */ public function get($name) { $name = $this->options['prefix'] . $name; if (xcache_isset($name)) { return xcache_get($name); } return false; }
function driver_isExisting($keyword) { if (xcache_isset($keyword)) { return true; } else { return false; } }
public function get($name, $cache_level = null) { $key = $this->_mapTags($name) . '/' . $cache_level; if (xcache_isset($key)) { return array(xcache_get($key)); } return false; }
/** * Retrieve a value from remote cache store * * @param string Cache unique key * @return @e mixed */ public function getFromCache($key) { $return_val = ""; if (xcache_isset(md5($this->identifier . $key))) { $return_val = xcache_get(md5($this->identifier . $key)); } return $return_val; }
public function get($key) { if (xcache_isset($key)) { return xcache_get($key); } else { return false; } }
/** +---------------------------------------------------------- * 读取缓存 +---------------------------------------------------------- * @access public +---------------------------------------------------------- * @param string $name 缓存变量名 +---------------------------------------------------------- * @return mixed +---------------------------------------------------------- */ public function get($name) { $this->Q(1); if (xcache_isset($name)) { return xcache_get($name); } return false; }
public function update($key, $value, $ttl = 0, $tableName, $connectionResource) { $key = $this->getRealKey($tableName, $key); if (xcache_isset($key)) { return xcache_set($key, $value, $ttl); } return false; }
/** +---------------------------------------------------------- * 读取缓存 +---------------------------------------------------------- * @access public +---------------------------------------------------------- * @param string $name 缓存变量名 +---------------------------------------------------------- * @return mixed +---------------------------------------------------------- */ public function get($name) { N('cache_read', 1); if (xcache_isset($name)) { return xcache_get($name); } return false; }
public function ping($key) { if (xcache_isset($this->id)) { return parent::ping($key); } else { return false; } }
/** * Remove a cached data entry by id and group * * @access public * @param string $id The cache data id * @param string $group The cache data group * @return boolean True on success, false otherwise * @since 1.5 */ function remove($id, $group) { $cache_id = $this->_getCacheId($id, $group); if (!xcache_isset($cache_id)) { return true; } return xcache_unset($cache_id); }
/** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function destroy($id) { $sess_id = 'sess_' . $id; if (!xcache_isset($sess_id)) { return true; } return xcache_unset($sess_id); }
public function getHandlers() { $key = $this->_mapTags($this->_handlers_name, 0); if (xcache_isset($key)) { $result = xcache_get($key); return $result; } return array(); }
public function exists($key) { $time = time(); $cachetime = intval(xcache_get($key . '_expires')); if ($cachetime !== 0 && $cachetime < $time) { return false; } return xcache_isset($key); }
/** * 读取缓存 * @access public * @param string $name 缓存变量名 * @return mixed */ public function get($name) { \think\Cache::$readTimes++; $name = $this->options['prefix'] . $name; if (xcache_isset($name)) { return xcache_get($name); } return false; }
/** * Get an object from the cache. * @param $id */ function getCache($id) { $key = INDEX_FILE_LOCATION . ':' . $this->getContext() . ':' . $this->getCacheId() . ':' . $id; if (!xcache_isset($key)) { return $this->cacheMiss; } $returner = unserialize(xcache_get($key)); return $returner; }
public function fetch($key, &$result) { if (xcache_isset($key)) { $result = xcache_get($key); return true; } else { return false; } }