• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP xcache_inc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: store

 public function store($key, $value)
 {
     if (xcache_set($key, $value)) {
         xcache_inc('__known_xcache_size', strlen($value));
     }
     return false;
 }
开发者ID:sensiblemn,项目名称:Known,代码行数:7,代码来源:XCache.php


示例2: incrementValue

 /**
  * {@inheritdoc}
  */
 protected function incrementValue($key, $value)
 {
     if (is_int($inc = xcache_inc($key, (int) $value))) {
         return $inc;
     }
     return false;
 }
开发者ID:lucidphp,项目名称:cache,代码行数:10,代码来源:XcacheDriver.php


示例3: 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


示例4: 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


示例5: increment

 /**
  * Increment the value of an item in the cache.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @return void
  */
 public function increment($key, $value = 1)
 {
     return xcache_inc($this->prefix . $key, $value);
 }
开发者ID:kartx22,项目名称:Otoru-Dice,代码行数:11,代码来源:XCacheStore.php


示例6: increment

 /**
  * 
  * Increments a cache entry value by the specified amount.  If the entry
  * does not exist, creates it at zero, then increments it.
  * 
  * @param string $key The entry ID.
  * 
  * @param string $amt The amount to increment by (default +1).  Using
  * negative values is effectively a decrement.
  * 
  * @return int The new value of the cache entry.
  * 
  */
 public function increment($key, $amt = 1)
 {
     if (!$this->_active) {
         return;
     }
     // modify the key to add the prefix
     $key = $this->entry($key);
     // make sure we have a key to increment
     $this->add($key, 0, null, $this->_life);
     // let xcache do the increment and retain its value
     $val = xcache_inc($key, $amt, $this->_life);
     // done
     return $val;
 }
开发者ID:agentile,项目名称:foresmo,代码行数:27,代码来源:Xcache.php


示例7: inc

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


示例8: internalIncrementItem

 /**
  * Internal method to increment an item.
  *
  * @param  string $normalizedKey
  * @param  int    $value
  * @return int|bool The new value on success, false on failure
  * @throws Exception\ExceptionInterface
  */
 protected function internalIncrementItem(&$normalizedKey, &$value)
 {
     $options = $this->getOptions();
     $namespace = $options->getNamespace();
     $prefix = $namespace === '' ? '' : $namespace . $options->getNamespaceSeparator();
     $internalKey = $prefix . $normalizedKey;
     $ttl = $options->getTtl();
     $value = (int) $value;
     return xcache_inc($internalKey, $value, $ttl);
 }
开发者ID:karnurik,项目名称:zf2-turtorial,代码行数:18,代码来源:XCache.php


示例9: incr

 public function incr($key, $value = 1)
 {
     return xcache_inc($key, $value);
 }
开发者ID:h4ck3rm1k3,项目名称:mediawiki,代码行数:4,代码来源:XCacheBagOStuff.php


示例10: increment

 function increment($key, $by = 1)
 {
     $formatted = \Cachet\Helper::formatKey([$this->prefix, 'counter', $key]);
     $value = xcache_inc($formatted, $by, $this->counterTTL);
     return $value;
 }
开发者ID:shabbyrobe,项目名称:cachet,代码行数:6,代码来源:XCache.php


示例11: inc

 /**
  * Increase a stored number
  *
  * @param string $key
  * @param int $step
  * @return int | bool
  */
 public function inc($key, $step = 1)
 {
     return xcache_inc($this->getPrefix() . $key, $step);
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:11,代码来源:XCache.php


示例12: _flush_pool

 /**
  * @param string $key
  * @return array|int
  */
 private function _flush_pool($key = null)
 {
     if (!$this->_get_counter_status()) {
         return [];
     }
     if (empty($this->_pool)) {
         return [];
     }
     if ($key === null) {
         $result = [];
         foreach ($this->_pool as $_key => $_val) {
             $result[$_key] = xcache_inc($_key, $_val);
         }
         $this->_pool = [];
         return $result;
     }
     $_count = 0;
     $key = $this->_hash_key($key);
     if (isset($this->_pool[$key])) {
         $_count = $this->_pool[$key];
         xcache_inc($key, $_count);
         unset($this->_pool[$key]);
     }
     return $_count;
 }
开发者ID:vincenttone,项目名称:daf,代码行数:29,代码来源:counter.php


示例13: inc

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


示例14: increment

 /**
  * Emulates `Memcache::increment`.
  */
 public function increment($key, $value = 1)
 {
     return xcache_inc(self::$key_prefix . $key, $value);
 }
开发者ID:Selwyn-b,项目名称:elefant,代码行数:7,代码来源:MemcacheXCache.php


示例15: increment

 /**
  * Increment the value of an item in the cache.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @return int
  */
 public function increment($key, $value = 1)
 {
     return xcache_inc($this->getPrefixWithLocale() . $key, $value);
 }
开发者ID:jooorooo,项目名称:cache,代码行数:11,代码来源:XCacheStore.php


示例16: incr

 /**
  * Increase the value of a key by $amount.
  * 
  * If the key does not exist, this method assumes that the current value is zero.
  * This method returns the new value.
  * 
  * @param string $key
  * @param int $amount
  * @return int
  */
 public function incr($key, $amount)
 {
     return xcache_inc($key, $amount);
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:14,代码来源:xcache.php


示例17: increment

 /**
  * Increments 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 integer $offset How much to increment
  * @return New incremented value, false otherwise
  */
 public function increment($key, $offset = 1)
 {
     return xcache_inc($key, $offset);
 }
开发者ID:Nervie,项目名称:Beta,代码行数:12,代码来源:XcacheEngine.php


示例18: inc

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


示例19: increase

 /**
  * Increases the value in the variable store
  * @param string $key The key of the variable
  * @param integer $value The value to increase 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 increase($key, $value = null, $timeToLive = null)
 {
     return xcache_inc($key, $value, $timeToLive);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:11,代码来源:XCacheIO.php


示例20: increment

 /**
  * Performs an atomic increment 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.
  *
  * @param string $key Key of numeric cache item to increment
  * @param integer $offset Offset to increment - defaults to 1.
  * @return mixed Item's new value on successful increment, false otherwise
  */
 public function increment($key, $offset = 1)
 {
     return function ($self, $params, $chain) use($offset) {
         extract($params);
         return xcache_inc($key, $offset);
     };
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:17,代码来源:XCache.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP xcache_info函数代码示例发布时间:2022-05-23
下一篇:
PHP xcache_get函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap