當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wincache_ucache_get函數代碼示例

本文整理匯總了PHP中wincache_ucache_get函數的典型用法代碼示例。如果您正苦於以下問題:PHP wincache_ucache_get函數的具體用法?PHP wincache_ucache_get怎麽用?PHP wincache_ucache_get使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了wincache_ucache_get函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get

 /**
  * Retrieve an item from the cache by key.
  *
  * @param  string  $key
  * @return mixed
  */
 public function get($key)
 {
     $value = wincache_ucache_get($this->getPrefixWithLocale() . $key);
     if ($value !== false) {
         return $value;
     }
 }
開發者ID:jooorooo,項目名稱:cache,代碼行數:13,代碼來源:WinCacheStore.php

示例2: set

 /**
  * 寫入緩存
  * @access public
  * @param string $name 緩存變量名
  * @param mixed $value  存儲數據
  * @param integer $expire  有效時間(秒)
  * @return boolean
  */
 public function set($name, $value, $expire = null)
 {
     \think\Cache::$writeTimes++;
     if (is_null($expire)) {
         $expire = $this->options['expire'];
     }
     $name = $this->options['prefix'] . $name;
     if (wincache_ucache_set($name, $value, $expire)) {
         if ($this->options['length'] > 0) {
             // 記錄緩存隊列
             $queue = wincache_ucache_get('__info__');
             if (!$queue) {
                 $queue = [];
             }
             if (false === array_search($name, $queue)) {
                 array_push($queue, $name);
             }
             if (count($queue) > $this->options['length']) {
                 // 出列
                 $key = array_shift($queue);
                 // 刪除緩存
                 wincache_ucache_delete($key);
             }
             wincache_ucache_set('__info__', $queue);
         }
         return true;
     }
     return false;
 }
開發者ID:zhaomingliang,項目名稱:think,代碼行數:37,代碼來源:wincache.php

示例3: _getExternal

 /**
  * @see SugarCacheAbstract::_getExternal()
  */
 protected function _getExternal($key)
 {
     if (!wincache_ucache_exists($key)) {
         return null;
     }
     return wincache_ucache_get($key);
 }
開發者ID:omusico,項目名稱:sugar_work,代碼行數:10,代碼來源:SugarCacheWincache.php

示例4: get

 /**
  * Get
  *
  * Look for a value in the cache. If it exists, return the data,
  * if not, return FALSE
  *
  * @param	string	$id	Cache Ide
  * @return	mixed	Value that is stored/FALSE on failure
  */
 public function get($id)
 {
     $success = FALSE;
     $data = wincache_ucache_get($id, $success);
     // Success returned by reference from wincache_ucache_get()
     return $success ? $data : FALSE;
 }
開發者ID:alyayazilim,項目名稱:E-Ticaret-2015,代碼行數:16,代碼來源:Cache_wincache.php

示例5: retrieveItem

 /**
  * Retrieve an item from the cache by key.
  *
  * @param  string  $key
  * @return mixed
  */
 protected function retrieveItem($key)
 {
     $value = wincache_ucache_get($this->prefix . $key);
     if ($value !== false) {
         return $value;
     }
 }
開發者ID:defra91,項目名稱:levecchiecredenze.it,代碼行數:13,代碼來源:WinCacheStore.php

示例6: get

 /**
  * Retrieve an item from the cache by key.
  *
  * @param  string  $key
  * @return mixed
  */
 public function get($key)
 {
     $value = wincache_ucache_get($this->prefix . $key);
     if ($value !== false) {
         return $value;
     }
 }
開發者ID:Thomvh,項目名稱:turbine,代碼行數:13,代碼來源:WinCacheStore.php

示例7: _doFetch

 /**
  * Fetch a cache record from this cache driver instance
  *
  * @param string $id cache id
  * @param boolean $testCacheValidity        if set to false, the cache validity won't be tested
  * @return mixed  Returns either the cached data or false
  */
 protected function _doFetch($id, $testCacheValidity = true)
 {
     $cache = wincache_ucache_get($id, $success);
     if ($success === false) {
         return false;
     }
     return $cache;
 }
開發者ID:juokaz,項目名稱:wincache-adapters,代碼行數:15,代碼來源:WinCache.php

示例8: get

 public function get($key)
 {
     if (wincache_ucache_exists($this->type . '_' . $key)) {
         $data = wincache_ucache_get($this->type . '_' . $key);
         return $data;
     }
     return false;
 }
開發者ID:blanc0,項目名稱:cecilia,代碼行數:8,代碼來源:WinCache.php

示例9: get

 /**
  * 獲取一個已經緩存的變量
  *
  * @access public
  *
  * @param string $key 緩存Key
  *
  * @return mixed
  */
 public function get($key)
 {
     //參數分析
     if ($key) {
         return false;
     }
     return wincache_ucache_get($key);
 }
開發者ID:a53abc,項目名稱:doitphp,代碼行數:17,代碼來源:Cache_Wincache.class.php

示例10: get

 /**
  * Retrieve a cached value entry by id.
  * 
  *     // Retrieve cache entry from wincache group
  *     $data = Cache::instance('wincache')->get('foo');
  * 
  *     // Retrieve cache entry from wincache group and return 'bar' if miss
  *     $data = Cache::instance('wincache')->get('foo', 'bar');
  *
  * @param   string   id of cache to entry
  * @param   string   default value to return if cache miss
  * @return  mixed
  * @throws  Cache_Exception
  */
 public function get($id, $default = NULL)
 {
     // for ProfilerToolbar
     ProfilerToolbar::cacheLog('get', array_search($this, Cache::$instances), $id);
     // /for ProfilerToolbar
     $data = wincache_ucache_get($this->_sanitize_id($id), $success);
     return $success ? $data : $default;
 }
開發者ID:tscms,項目名稱:profilertoolbar,代碼行數:22,代碼來源:Wincache.php

示例11: cs_cache_load

function cs_cache_load($name, $ttl = 0)
{
    $token = empty($ttl) ? $name : 'ttl_' . $name;
    if (wincache_ucache_exists($token)) {
        return wincache_ucache_get($token);
    }
    return false;
}
開發者ID:aberrios,項目名稱:WEBTHESGO,代碼行數:8,代碼來源:wincache.php

示例12: get

 /**
  * {@inheritdoc}
  */
 public function get($key)
 {
     $value = wincache_ucache_get($this->key($key), $success);
     if (!$success) {
         return null;
     }
     return $value;
 }
開發者ID:vpg,項目名稱:titon.cache,代碼行數:11,代碼來源:WincacheStorage.php

示例13: get

 /**
  * Fetches an item from the cache if it is still valid
  *
  * @param string $key
  * @return mixed
  */
 public function get($key)
 {
     $value = wincache_ucache_get($key, $success);
     if ($success) {
         return $value;
     }
     return false;
 }
開發者ID:jinshana,項目名稱:tangocms,代碼行數:14,代碼來源:Wincache.php

示例14: get

 /**
  * @param string $key
  * @return mixed
  */
 public function get($key)
 {
     $value = wincache_ucache_get($key, $sucess);
     if ($sucess == false) {
         return null;
     }
     return $value;
 }
開發者ID:mactronique,項目名稱:phpcache,代碼行數:12,代碼來源:WincacheDriver.php

示例15: get

 /**
  * Get a value from the WinCache object cache
  *
  * @param $key String: cache key
  * @return mixed
  */
 public function get($key)
 {
     $val = wincache_ucache_get($key);
     if (is_string($val)) {
         $val = unserialize($val);
     }
     return $val;
 }
開發者ID:seedbank,項目名稱:old-repo,代碼行數:14,代碼來源:WinCacheBagOStuff.php


注:本文中的wincache_ucache_get函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。