当前位置: 首页>>代码示例>>PHP>>正文


PHP xcache_dec函数代码示例

本文整理汇总了PHP中xcache_dec函数的典型用法代码示例。如果您正苦于以下问题:PHP xcache_dec函数的具体用法?PHP xcache_dec怎么用?PHP xcache_dec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xcache_dec函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 public function add($key, $value = 1, $ttl = 600)
 {
     $result = 0;
     if (is_numeric($value)) {
         $result = $value > 0 ? xcache_inc($key, $value, $ttl) : xcache_dec($key, abs($value), $ttl);
     }
     return $result;
 }
开发者ID:laiello,项目名称:mystep-cms,代码行数:8,代码来源:xcache.class.php

示例2: modifyInteger

 public function modifyInteger($key, $offset, &$success = null)
 {
     $success = false;
     if ($offset > 0) {
         $newValue = xcache_inc($key, $offset);
     } else {
         $newValue = xcache_dec($key, abs($offset));
     }
     if (is_int($newValue)) {
         $success = true;
     }
     return $newValue;
 }
开发者ID:kuria,项目名称:cache,代码行数:13,代码来源:XcacheDriver.php

示例3: decrement

 /**
  * Decrements the value of an integer cached key.
  * If the cache key is not an integer it will be treated as 0
  *
  * @param string $key Identifier for the data
  * @param int $offset How much to subtract
  * @return New decremented value, false otherwise
  */
 public function decrement($key, $offset = 1)
 {
     return xcache_dec($key, $offset);
 }
开发者ID:keetamhoang,项目名称:lotdephong,代码行数:12,代码来源:XcacheEngine.php

示例4: decrement

 /**
  * Decrements the value of an integer cached key.
  * If the cache key is not an integer it will be treated as 0
  *
  * @param string $key Identifier for the data
  * @param int $offset How much to subtract
  * @return bool|int New decremented value, false otherwise
  */
 public function decrement($key, $offset = 1)
 {
     $key = $this->_key($key);
     return xcache_dec($key, $offset);
 }
开发者ID:fabioalvaro,项目名称:cakexuxu,代码行数:13,代码来源:XcacheEngine.php

示例5: decrement

 /**
  * Performs an atomic decrement operation on specified numeric cache item.
  *
  * Note that, as per the XCache specification:
  * If the item's value is not numeric, it is treated as if the value were 0.
  * It is possible to decrement a value into the negative integers.
  *
  * @param string $key Key of numeric cache item to decrement.
  * @param integer $offset Offset to decrement - defaults to `1`.
  * @return integer|boolean The item's new value on successful decrement, else `false`.
  */
 public function decrement($key, $offset = 1)
 {
     return xcache_dec($this->_config['scope'] ? "{$this->_config['scope']}:{$key}" : $key, $offset);
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:15,代码来源:XCache.php

示例6: decrement

 /**
  * Performs an atomic decrement operation on specified numeric cache item.
  *
  * Note that, as per the XCache specification:
  * If the item's value is not numeric, it is treated as if the value were 0.
  * It is possible to decrement a value into the negative integers.
  *
  * @param string $key Key of numeric cache item to decrement
  * @param integer $offset Offset to decrement - defaults to 1.
  * @return mixed Item's new value on successful decrement, false otherwise
  */
 public function decrement($key, $offset = 1)
 {
     return function ($self, $params, $chain) use($offset) {
         extract($params);
         return xcache_dec($key, $offset);
     };
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:18,代码来源:XCache.php

示例7: dec

 public function dec($key, $step = 1)
 {
     $this->type = $type;
     return xcache_dec($this->_key($key), $step);
 }
开发者ID:noikiy,项目名称:nc-1,代码行数:5,代码来源:cache.xcache.php

示例8: decrement

 /**
  * {@inheritdoc}
  */
 public function decrement($name, $delta = 1)
 {
     return xcache_dec($this->options['prefix'] . $name, $delta);
 }
开发者ID:jwdeitch,项目名称:components,代码行数:7,代码来源:XCacheStore.php

示例9: dec

 /**
  * @see Temporary_cache_driver::dec()
  */
 public function dec($id, $realm = COT_DEFAULT_REALM, $value = 1)
 {
     return xcache_dec($realm . '/' . $id, $value);
 }
开发者ID:Cotonti,项目名称:valencia,代码行数:7,代码来源:cache.php

示例10: decrement

 public function decrement($key, $step = 1)
 {
     return \xcache_dec($key, $step);
 }
开发者ID:tempbottle,项目名称:zphp,代码行数:4,代码来源:XCache.php

示例11: decrease

 /**
  * Decreases the value in the variable store
  * @param string $key The key of the variable
  * @param integer $value The value to decrease with
  * @param integer $timeToLive Set to a number of seconds to make the variable expire in that amount of time
  * @return mixed The new value of the variable
  */
 public function decrease($key, $value = null, $timeToLive = null)
 {
     return xcache_dec($key, $value, $timeToLive);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:11,代码来源:XCacheIO.php

示例12: intdec

 static function intdec($key, $value, $ttl)
 {
     return xcache_dec($key, $value, $ttl);
 }
开发者ID:a0000778,项目名称:chat1,代码行数:4,代码来源:cache.class.php

示例13: decr

 public function decr($id, $val = 1, $group = Cache::DEFAULT_GROUP, $ttl = Cache::DEFAULT_TTL)
 {
     return xcache_dec($this->getPrefix($group) . $id, $val, $ttl);
 }
开发者ID:phpf,项目名称:micro,代码行数:4,代码来源:XCacheDriver.php

示例14: dec

 /**
  * Decrements numeric cache item's value.
  *
  * {@inheritDoc}
  *
  * @see \app\src\Cache\etsis_Abstract_Cache::dec()
  *
  * @since 6.2.0
  * @param int|string $key
  *            The cache key to decrement.
  * @param int $offset
  *            Optional. The amount by which to decrement the item's value. Default: 1.
  * @param string $namespace
  *            Optional. The namespace the key is in. Default: 'default'.
  * @return false|int False on failure, the item's new value on success.
  */
 public function dec($key, $offset = 1, $namespace = 'default')
 {
     $unique_key = $this->uniqueKey($key, $namespace);
     return xcache_dec($unique_key, (int) $offset);
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:21,代码来源:etsis_Cache_XCache.php

示例15: decr

 public function decr($id, $value = 1, $ttl = Cache::DEFAULT_TTL)
 {
     return xcache_dec($this->prefix . $id, $value, $ttl);
 }
开发者ID:wells5609,项目名称:wp-app,代码行数:4,代码来源:XCache.php


注:本文中的xcache_dec函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。