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


PHP wincache_ucache_inc函数代码示例

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


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

示例1: increment

 /**
  * @inheritdoc
  */
 public function increment($name, $offset = 1)
 {
     $success = false;
     $value = wincache_ucache_inc($name, $offset, $success);
     return $success === true ? $value : false;
 }
开发者ID:dp-ifacesoft,项目名称:micro,代码行数:9,代码来源:WincacheCache.php

示例2: modifyInteger

 public function modifyInteger($key, $offset, &$success = null)
 {
     return @wincache_ucache_inc($key, $offset, $success);
 }
开发者ID:kuria,项目名称:cache,代码行数:4,代码来源:WinCacheDriver.php

示例3: increment

 /**
  * Increment a raw value
  *
  * @param	string	$id	Cache ID
  * @param	int	$offset	Step/value to add
  * @return	mixed	New value on success or FALSE on failure
  */
 public function increment($id, $offset = 1)
 {
     $success = FALSE;
     $value = wincache_ucache_inc($id, $offset, $success);
     return $success === TRUE ? $value : FALSE;
 }
开发者ID:alyayazilim,项目名称:E-Ticaret-2015,代码行数:13,代码来源:Cache_wincache.php

示例4: internalIncrementItem

 /**
  * Internal method to increment an item.
  *
  * Options:
  *  - ttl <float>
  *    - The time-to-life
  *  - namespace <string>
  *    - The namespace to use
  *
  * @param  string $normalizedKey
  * @param  int    $value
  * @param  array  $normalizedOptions
  * @return int|boolean The new value on success, false on failure
  * @throws Exception\ExceptionInterface
  */
 protected function internalIncrementItem(& $normalizedKey, & $value, array & $normalizedOptions)
 {
     $internalKey = $normalizedOptions['namespace'] . $this->getOptions()->getNamespaceSeparator() . $normalizedKey;
     return wincache_ucache_inc($internalKey, (int)$value);
 }
开发者ID:necrogami,项目名称:zf2,代码行数:20,代码来源:WinCache.php

示例5: incr2

 function incr2($id, $n, $group)
 {
     $key = $this->key($id, $group);
     return wincache_ucache_inc($key, $n);
 }
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:5,代码来源:wincache.object-cache.php

示例6: inc

 /**
  * Increments the value associated with the key
  *
  * The third parameter has been replaced by $this->getLastIncResult();
  *
  * @see wincache_ucache_inc();
  */
 public function inc($key, $inc_by = 1)
 {
     $result = wincache_ucache_inc($key, $inc_by, $this->last_inc_result);
     $this->clearInfoArrays();
     return $result;
 }
开发者ID:veloper,项目名称:DDWinUCache,代码行数:13,代码来源:class.ddwinucache.php

示例7: incrementItem

 /**
  * Increment 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 on failure
  * @throws Exception
  *
  * @triggers incrementItem.pre(PreEvent)
  * @triggers incrementItem.post(PostEvent)
  * @triggers incrementItem.exception(ExceptionEvent)
  */
 public function incrementItem($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_inc($internalKey, $value);
         if ($newValue === false) {
             if (wincache_ucache_exists($internalKey)) {
                 throw new Exception\RuntimeException("wincache_ucache_inc('{$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

示例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;
     return wincache_ucache_inc($internalKey, (int) $value);
 }
开发者ID:CHRISTOPHERVANDOMME,项目名称:zf2complet,代码行数:16,代码来源:WinCache.php

示例9: inc

 /**
  * 自增缓存(针对数值缓存)
  * @access public
  * @param string    $name 缓存变量名
  * @param int       $step 步长
  * @return false|int
  */
 public function inc($name, $step = 1)
 {
     $key = $this->getCacheKey($name);
     return wincache_ucache_inc($key, $step);
 }
开发者ID:top-think,项目名称:framework,代码行数:12,代码来源:Wincache.php

示例10: increment

 public function increment($key, $increment)
 {
     $success = false;
     $value = wincache_ucache_inc($key, $increment, $success);
     return $success === true ? $value : false;
 }
开发者ID:znframework,项目名称:znframework,代码行数:6,代码来源:Wincache.php

示例11: increment

 public function increment($key, $increment = 1)
 {
     $success = false;
     if (function_exists('wincache_ucache_inc')) {
         $value = wincache_ucache_inc($key, $increment, $success);
     } else {
         return getMessage('Cache', 'unsupported', 'Wincache');
     }
     return $success === true ? $value : false;
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:10,代码来源:WincacheDriver.php

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

示例13: 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)
 {
     $result = wincache_ucache_inc($key, $amount);
     if ($result === false) {
         wincache_ucache_set($key, $amount);
         $result = $amount;
     }
     return $result;
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:19,代码来源:wincache.php

示例14: internalIncrementItem

 /**
  * Internal method to increment 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 internalIncrementItem(&$normalizedKey, &$value, array &$normalizedOptions)
 {
     $internalKey = $normalizedOptions['namespace'] . $this->getOptions()->getNamespaceSeparator() . $normalizedKey;
     $value = (int) $value;
     $newValue = wincache_ucache_inc($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

示例15: inc

 public function inc($key, $step = 1)
 {
     return wincache_ucache_inc($key, $step);
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:4,代码来源:memory_driver_wincache.php


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