本文整理汇总了PHP中wincache_ucache_exists函数的典型用法代码示例。如果您正苦于以下问题:PHP wincache_ucache_exists函数的具体用法?PHP wincache_ucache_exists怎么用?PHP wincache_ucache_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wincache_ucache_exists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _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
示例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;
}
开发者ID:e-gob,项目名称:apps.gob.cl,代码行数:8,代码来源:xpdowincache.class.php
示例3: driver_isExisting
function driver_isExisting($keyword)
{
if (wincache_ucache_exists($keyword)) {
return true;
} else {
return false;
}
}
开发者ID:rylanb,项目名称:Play-Later,代码行数:8,代码来源:wincache.php
示例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;
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:8,代码来源:wincache.php
示例5: 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
示例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;
}
开发者ID:kumarsivarajan,项目名称:ctrl-dock,代码行数:25,代码来源:Wincache.php
示例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>
开发者ID:laiello,项目名称:kangle-php-mysql,代码行数:31,代码来源:wincache.php
示例8: has
/**
* {@inheritdoc}
*/
public function has($key)
{
return wincache_ucache_exists($key);
}
开发者ID:muhammetardayildiz,项目名称:framework,代码行数:7,代码来源:WinCache.php
示例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;
}
开发者ID:novnan,项目名称:meiju,代码行数:12,代码来源:Wincache.class.php
示例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);
}
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:15,代码来源:WinCache.php
示例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);
}
开发者ID:lisong,项目名称:incubator,代码行数:16,代码来源:Wincache.php
示例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);
}
}
开发者ID:navtis,项目名称:xerxes-pazpar2,代码行数:50,代码来源:WinCache.php
示例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;
}
开发者ID:top-think,项目名称:framework,代码行数:12,代码来源:Wincache.php
示例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);
}
开发者ID:Clansuite,项目名称:Clansuite,代码行数:10,代码来源:Wincache.php
示例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));
}
开发者ID:mined-gatech,项目名称:framework,代码行数:10,代码来源:WinCache.php
示例16: exists
/**
* {@inheritdoc}
*
* @param string $keyName
* @param string $lifetime
* @return boolean
*/
public function exists($keyName = null, $lifetime = null)
{
return wincache_ucache_exists($keyName);
}
开发者ID:shatkovskiy,项目名称:phalcon-sms-factory,代码行数:11,代码来源:Wincache.php
示例17: internalDecrementItem
/**
* Internal method to decrement an item.
*
* Options:
* - ttl <float>
* - The time-to-life
* - namespace <string>
* - The namespace to use
* - ignore_missing_items <boolean>
* - Throw exception on missing item
*
* @param string $normalizedKey
* @param int $value
* @param array $normalizedOptions
* @return int|boolean The new value or false on failure
* @throws Exception
*/
protected function internalDecrementItem(&$normalizedKey, &$value, array &$normalizedOptions)
{
$internalKey = $normalizedOptions['namespace'] . $this->getOptions()->getNamespaceSeparator() . $normalizedKey;
$value = (int) $value;
$newValue = wincache_ucache_dec($internalKey, $value);
if ($newValue === false) {
if (wincache_ucache_exists($internalKey)) {
throw new Exception\RuntimeException("wincache_ucache_inc('{$internalKey}', {$value}) failed");
} elseif (!$normalizedOptions['ignore_missing_items']) {
throw new Exception\ItemNotFoundException("Key '{$internalKey}' not found");
}
$newValue = -$value;
$this->addItem($normalizedKey, $newValue, $normalizedOptions);
}
return $newValue;
}
开发者ID:bradley-holt,项目名称:zf2,代码行数:33,代码来源:WinCache.php
示例18: exists
/**
* Checks if a specified key is in the storage.
*
* @param string $key Name of key to check.
*
* @return bool TRUE if the key is in the storage, FALSE otherwise.
*/
public function exists($key)
{
return wincache_ucache_exists($this->persistentId . $key);
}
开发者ID:CBEPX,项目名称:yii2-mikrotik,代码行数:11,代码来源:Wincache.php
示例19: has
/**
* Checks if a cache entry with the specified identifier exists
*
* @param string $entryIdentifier An identifier specifying the cache entry
* @return boolean TRUE if such an entry exists, FALSE if not
*/
public function has($entryIdentifier)
{
return wincache_ucache_exists($this->identifierPrefix . $entryIdentifier);
}
开发者ID:allipierre,项目名称:Typo3,代码行数:10,代码来源:WincacheBackend.php
示例20: increment
/**
* 递增
*
* 与原始increment方法区别的是若不存指定KEY时返回false,这个会自动递增
*
* @param string $key
* @param int $offset
* @param int $lifetime 当递减失则时当作set使用
* @return boolean
*/
public function increment($key, $offset = 1, $lifetime = 60)
{
if (wincache_ucache_inc($this->prefix . $key, $offset)) {
return true;
} elseif (false == wincache_ucache_exists($this->prefix . $key) && $this->set($key, $offset, $lifetime)) {
return true;
} else {
return false;
}
}
开发者ID:liuyu121,项目名称:myqee,代码行数:20,代码来源:wincache.class.php
注:本文中的wincache_ucache_exists函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论