本文整理汇总了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;
}