コード例 #1
0
ファイル: XCache.php プロジェクト: tempbottle/zphp
 public function add($key, $value, $timeOut = 0)
 {
     if (\xcache_isset($key)) {
         return false;
     }
     return \xcache_set($key, $value, $timeOut);
 }
コード例 #2
0
ファイル: XCacheIO.php プロジェクト: BGCX261/zibo-svn-to-git
 /**
  * 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 /**
  * @param string $key
  * @return boolean
  */
 public function delete($key)
 {
     if (!xcache_isset($key)) {
         return TRUE;
     }
     return xcache_unset($key);
 }
コード例 #5
0
 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;
 }
コード例 #6
0
ファイル: xcache.php プロジェクト: slothly/mybb
 /**
  * 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);
 }
コード例 #7
0
ファイル: XCache.php プロジェクト: appdeck/sampa
 public function __isset($index)
 {
     if (function_exists('xcache_isset')) {
         return xcache_isset($index);
     }
     return false;
 }
コード例 #8
0
 /**
  * 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;
 }
コード例 #9
0
 /**
  * 读取缓存,失败或缓存撒失效时返回 false
  *
  * @param string $id
  *
  * @return mixed
  */
 function get($id)
 {
     if (xcache_isset($id)) {
         return xcache_get($id);
     }
     return false;
 }
コード例 #10
0
ファイル: XCache.php プロジェクト: mdzzohrabi/azera-cache
 /**
  * {@inheritdoc}
  */
 public function expired($key, $mins)
 {
     $key = $this->getName($key);
     if (xcache_isset($key)) {
         return time() - xcache_get($key)['created'] > $mins * 60;
     }
 }
コード例 #11
0
 public function get($key)
 {
     if (!$key) {
         return false;
     }
     return xcache_isset($key) ? xcache_get($key) : false;
 }
コード例 #12
0
ファイル: xcache.php プロジェクト: atlas1308/testtesttestfarm
 public function get($id)
 {
     if (xcache_isset($id)) {
         return xcache_get($id);
     }
     return NULL;
 }
コード例 #13
0
ファイル: XCache.php プロジェクト: umisoft/umi.framework
 /**
  * {@inheritdoc}
  */
 public function add($key, $value, $ttl = 0)
 {
     if (!xcache_isset($key)) {
         return xcache_set($key, $value, $ttl);
     }
     return false;
 }
コード例 #14
0
 /**
  * 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);
 }
コード例 #15
0
 /**
  * 读取缓存
  * @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;
 }
コード例 #16
0
ファイル: xcache.php プロジェクト: kvox/TVSS
 function driver_isExisting($keyword)
 {
     if (xcache_isset($keyword)) {
         return true;
     } else {
         return false;
     }
 }
コード例 #17
0
ファイル: Xcache.php プロジェクト: askzap/ultimate
 public function get($name, $cache_level = null)
 {
     $key = $this->_mapTags($name) . '/' . $cache_level;
     if (xcache_isset($key)) {
         return array(xcache_get($key));
     }
     return false;
 }
コード例 #18
0
 /**
  * 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;
 }
コード例 #19
0
ファイル: xcache.class.php プロジェクト: laiello/mystep-cms
 public function get($key)
 {
     if (xcache_isset($key)) {
         return xcache_get($key);
     } else {
         return false;
     }
 }
コード例 #20
0
ファイル: CacheXcache.class.php プロジェクト: cjmi/miniblog
 /**
 +----------------------------------------------------------
 * 读取缓存
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @param string $name 缓存变量名
 +----------------------------------------------------------
 * @return mixed
 +----------------------------------------------------------
 */
 public function get($name)
 {
     $this->Q(1);
     if (xcache_isset($name)) {
         return xcache_get($name);
     }
     return false;
 }
コード例 #21
0
ファイル: CacheAdapterXcache.php プロジェクト: kwdwkiss/trial
 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;
 }
コード例 #22
0
ファイル: CacheXcache.class.php プロジェクト: tmlsoft/main
 /**
 +----------------------------------------------------------
 * 读取缓存
 +----------------------------------------------------------
 * @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;
 }
コード例 #23
0
 public function ping($key)
 {
     if (xcache_isset($this->id)) {
         return parent::ping($key);
     } else {
         return false;
     }
 }
コード例 #24
0
ファイル: xcache.php プロジェクト: kaantunc/MYK-BOR
 /**
  * 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);
 }
コード例 #25
0
 /**
  * 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);
 }
コード例 #26
0
ファイル: Xcache.php プロジェクト: ambient-lounge/site
 public function getHandlers()
 {
     $key = $this->_mapTags($this->_handlers_name, 0);
     if (xcache_isset($key)) {
         $result = xcache_get($key);
         return $result;
     }
     return array();
 }
コード例 #27
0
ファイル: xcache.php プロジェクト: Bob-586/cx_old
 public function exists($key)
 {
     $time = time();
     $cachetime = intval(xcache_get($key . '_expires'));
     if ($cachetime !== 0 && $cachetime < $time) {
         return false;
     }
     return xcache_isset($key);
 }
コード例 #28
0
ファイル: xcache.php プロジェクト: zhaomingliang/think
 /**
  * 读取缓存
  * @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;
 }
コード例 #29
0
ファイル: XCacheCache.inc.php プロジェクト: doana/pkp-lib
 /**
  * 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;
 }
コード例 #30
0
ファイル: xcache.php プロジェクト: dalinhuang/shopexts
 public function fetch($key, &$result)
 {
     if (xcache_isset($key)) {
         $result = xcache_get($key);
         return true;
     } else {
         return false;
     }
 }