本文整理汇总了PHP中wincache_ucache_exists函数的典型用法代码示例。如果您正苦于以下问题:PHP wincache_ucache_exists函数的具体用法?PHP wincache_ucache_exists怎么用?PHP wincache_ucache_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wincache_ucache_exists函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getExternal
/**
* @see SugarCacheAbstract::_getExternal()
*/
protected function _getExternal($key)
{
if (!wincache_ucache_exists($key)) {
return null;
}
return wincache_ucache_get($key);
}
示例2: replace
public function replace($key, $var, $expire = 0, $options = array())
{
$replaced = false;
if (wincache_ucache_exists($key)) {
$replaced = wincache_ucache_set($this->getCacheKey($key), $var, $expire);
}
return $replaced;
}
示例3: driver_isExisting
function driver_isExisting($keyword)
{
if (wincache_ucache_exists($keyword)) {
return true;
} else {
return false;
}
}
示例4: 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;
}
示例5: get
public function get($key)
{
if (wincache_ucache_exists($this->type . '_' . $key)) {
$data = wincache_ucache_get($this->type . '_' . $key);
return $data;
}
return false;
}
示例6: isDataSet
/**
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
* @return void
* @return boolean
*/
public function isDataSet($pCoord)
{
// Check if the requested entry is the current object, or exists in the cache
if (parent::isDataSet($pCoord)) {
if ($this->_currentObjectID == $pCoord) {
return true;
}
// Check if the requested entry still exists in cache
$success = wincache_ucache_exists($this->_cachePrefix . $pCoord . '.cache');
if ($success === false) {
// Entry no longer exists in Wincache, so clear it from the cache array
parent::deleteCacheData($pCoord);
throw new Exception('Cell entry no longer exists in Wincache');
}
return true;
}
return false;
}
示例7:
}
?>
</table>
</div>
<?php
} else {
?>
<div class="overview">
<p class="notice">The user cache is not available. Enable the user cache by using <strong>wincache.ucenabled</strong>
directive in <strong>php.ini</strong> file.</p>
</div>
<?php
}
} else {
if ($page == UCACHE_DATA && $ucache_key != null && USE_AUTHENTICATION) {
if (!wincache_ucache_exists($ucache_key)) {
?>
<div class="overview">
<p class="notice">The variable with this key does not exist in the user cache.</p>
</div>
<?php
} else {
$ucache_entry_info = wincache_ucache_info(true, $ucache_key);
?>
<div class="list">
<table width="60%">
<tr>
<th colspan="2">User Cache Entry Information</th>
</tr>
<tr>
<td class="e">Key</td>
示例8: has
/**
* {@inheritdoc}
*/
public function has($key)
{
return wincache_ucache_exists($key);
}
示例9: get
/**
* 读取缓存
* @access public
* @param string $name 缓存变量名
* @return mixed
*/
public function get($name)
{
N('cache_read', 1);
$name = $this->options['prefix'] . $name;
return wincache_ucache_exists($name) ? wincache_ucache_get($name) : false;
}
示例10: exists
/**
* Checks whether a specified key exists in the cache.
* This can be faster than getting the value from the cache if the data is big.
* Note that this method does not check whether the dependency associated
* with the cached data, if there is any, has changed. So a call to [[get]]
* may return false while exists returns true.
* @param mixed $key a key identifying the cached value. This can be a simple string or
* a complex data structure consisting of factors representing the key.
* @return boolean true if a value exists in cache, false if the value is not in the cache or expired.
*/
public function exists($key)
{
$key = $this->buildKey($key);
return wincache_ucache_exists($key);
}
示例11: exists
/**
* {@inheritdoc}
*
* @param string $keyName
* @param string $lifetime
* @return boolean
*/
public function exists($keyName = null, $lifetime = null)
{
if ($keyName === null) {
$lastKey = $this->_lastKey;
} else {
$lastKey = $this->getPrefixedIdentifier($keyName);
}
return wincache_ucache_exists($lastKey);
}
示例12: decrementItem
/**
* Decrement an item.
*
* Options:
* - namespace <string> optional
* - The namespace to use (Default: namespace of object)
* - ignore_missing_items <boolean> optional
* - Throw exception on missing item or return false
*
* @param string $key
* @param int $value
* @param array $options
* @return int|boolean The new value or false or failure
* @throws Exception
*
* @triggers decrementItem.pre(PreEvent)
* @triggers decrementItem.post(PostEvent)
* @triggers decrementItem.exception(ExceptionEvent)
*/
public function decrementItem($key, $value, array $options = array())
{
$baseOptions = $this->getOptions();
if (!$baseOptions->getWritable()) {
return false;
}
$this->normalizeOptions($options);
$this->normalizeKey($key);
$args = new ArrayObject(array('key' => &$key, 'options' => &$options));
try {
$eventRs = $this->triggerPre(__FUNCTION__, $args);
if ($eventRs->stopped()) {
return $eventRs->last();
}
$internalKey = $options['namespace'] . $baseOptions->getNamespaceSeparator() . $key;
$value = (int) $value;
$newValue = wincache_ucache_dec($internalKey, $value);
if ($newValue === false) {
if (wincache_ucache_exists($internalKey)) {
throw new Exception\RuntimeException("wincache_ucache_dec('{$internalKey}', {$value}) failed");
} elseif (!$options['ignore_missing_items']) {
throw new Exception\ItemNotFoundException("Key '{$internalKey}' not found");
}
$this->addItem($key, -$value, $options);
$newValue = -$value;
}
return $this->triggerPost(__FUNCTION__, $args, $newValue);
} catch (\Exception $e) {
return $this->triggerException(__FUNCTION__, $args, $e);
}
}
示例13: get
/**
* 读取缓存
* @access public
* @param string $name 缓存变量名
* @param mixed $default 默认值
* @return mixed
*/
public function get($name, $default = false)
{
$key = $this->getCacheKey($name);
return wincache_ucache_exists($key) ? wincache_ucache_get($key) : $default;
}
示例14: contains
/**
* Contains checks if a key exists in the cache
*
* @param string $key Identifier for the data
* @return boolean true|false
*/
public function contains($key)
{
return wincache_ucache_exists($key);
}
示例15: has
/**
* Check if an item exists in the cache
*
* @param string $key
* @return bool
*/
public function has($key)
{
return wincache_ucache_exists($this->id($key));
}