本文整理匯總了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;
}
}
示例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;
}
示例3: _getExternal
/**
* @see SugarCacheAbstract::_getExternal()
*/
protected function _getExternal($key)
{
if (!wincache_ucache_exists($key)) {
return null;
}
return wincache_ucache_get($key);
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例8: get
public function get($key)
{
if (wincache_ucache_exists($this->type . '_' . $key)) {
$data = wincache_ucache_get($this->type . '_' . $key);
return $data;
}
return false;
}
示例9: get
/**
* 獲取一個已經緩存的變量
*
* @access public
*
* @param string $key 緩存Key
*
* @return mixed
*/
public function get($key)
{
//參數分析
if ($key) {
return false;
}
return wincache_ucache_get($key);
}
示例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;
}
示例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;
}
示例12: get
/**
* {@inheritdoc}
*/
public function get($key)
{
$value = wincache_ucache_get($this->key($key), $success);
if (!$success) {
return null;
}
return $value;
}
示例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;
}
示例14: get
/**
* @param string $key
* @return mixed
*/
public function get($key)
{
$value = wincache_ucache_get($key, $sucess);
if ($sucess == false) {
return null;
}
return $value;
}
示例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;
}