本文整理汇总了PHP中wincache_ucache_get函数的典型用法代码示例。如果您正苦于以下问题:PHP wincache_ucache_get函数的具体用法?PHP wincache_ucache_get怎么用?PHP wincache_ucache_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wincache_ucache_get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: getWithToken
protected function getWithToken($key, &$casToken, $flags = 0)
{
$val = wincache_ucache_get($key);
$casToken = $val;
if (is_string($val)) {
$val = unserialize($val);
}
return $val;
}
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:9,代码来源:WinCacheBagOStuff.php
示例17: _get
protected function _get($key)
{
$success = false;
$data = wincache_ucache_get($key, $success);
if ($success === false) {
return self::NOT_FOUND;
}
return $data;
}
开发者ID:liulingfu,项目名称:madserve,代码行数:9,代码来源:WinCache.php
示例18: read
/**
* 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
*/
public function read($key)
{
$time = time();
$cachetime = intval(wincache_ucache_get($key . '_expires'));
if ($cachetime < $time || $time + $this->settings['duration'] < $cachetime) {
return false;
}
return wincache_ucache_get($key);
}
开发者ID:gilyaev,项目名称:framework-bench,代码行数:16,代码来源:WincacheEngine.php
示例19: driverRead
/**
* @param \Psr\Cache\CacheItemInterface $item
* @return mixed
*/
protected function driverRead(CacheItemInterface $item)
{
$val = wincache_ucache_get($item->getKey(), $suc);
if ($suc === false) {
return null;
} else {
return $val;
}
}
开发者ID:jigoshop,项目名称:Jigoshop2,代码行数:13,代码来源:Driver.php
示例20: get
/**
* {@inheritdoc}
*/
public function get($key)
{
$cache = wincache_ucache_get($key, $success);
if ($success === true) {
return $cache;
} else {
return false;
}
}
开发者ID:muhammetardayildiz,项目名称:framework,代码行数:12,代码来源:WinCache.php
注:本文中的wincache_ucache_get函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论