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


PHP apc_dec函数代码示例

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


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

示例1: decrement

 public function decrement($k, $step = 1)
 {
     if ($this->core) {
         return $this->core->decrement($k, $step);
     }
     return apc_dec($k, $step);
 }
开发者ID:wukka,项目名称:store,代码行数:7,代码来源:Apc.php

示例2: dec

 public function dec($key, $step = 1, $success = TRUE)
 {
     if (_cacheStatus) {
         apc_dec($key, $step, $success);
     }
     return FALSE;
 }
开发者ID:no2key,项目名称:ZanPHP,代码行数:7,代码来源:apc.php

示例3: dec

 public function dec($key, $step = 1, $success = true)
 {
     if (CACHE_STATUS) {
         apc_dec($key, $step, $success);
     }
     return false;
 }
开发者ID:jgianpiere,项目名称:ZanPHP,代码行数:7,代码来源:apc.php

示例4: dec

 public function dec($key, $expire = 0)
 {
     $key = $this->buildKey($key);
     if (apc_dec($key) === false) {
         return apc_store($key, 0, $expire);
     }
     return true;
 }
开发者ID:rickysu,项目名称:tagcache,代码行数:8,代码来源:Apc.php

示例5: dec

 public function dec($key, $step = 1)
 {
     $this->type = $type;
     if (apc_dec($this->_key($key), $step) !== FALSE) {
         return apc_fetch($this->_key($key));
     }
     return FALSE;
 }
开发者ID:my1977,项目名称:shopnc,代码行数:8,代码来源:cache.apc.php

示例6: decrement

 /**
  * {@inheritdoc}
  */
 public function decrement($key, $amount = 1)
 {
     $result = apc_dec($this->getKey($key), $amount);
     if ($result < 0) {
         $result = 0;
         $this->set($key, $result);
     }
     return $result;
 }
开发者ID:ASP96,项目名称:imbo,代码行数:12,代码来源:APC.php

示例7: 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)
 {
     if ($value === null) {
         $value = 1;
     }
     // make sure the variable exists
     apc_add($key, 0);
     return apc_dec($key, $value);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:16,代码来源:ApcIO.php

示例8: testAPC

 public function testAPC()
 {
     $key = 'APCPolyfillTest';
     apc_store($key, 1);
     apc_inc($key, 2);
     apc_dec($key);
     $this->assertEquals(apc_fetch($key, $success), 2);
     $this->assertTrue($success);
     apc_delete($key);
     apc_fetch($key, $success);
     $this->assertFalse($success);
 }
开发者ID:lavoiesl,项目名称:apc-polyfill,代码行数:12,代码来源:APCPolyfillTest.php

示例9: internalDecrementItem

 /**
  * Internal method to decrement an item.
  *
  * @param  string $normalizedKey
  * @param  int    $value
  * @return int|boolean The new value on success, false on failure
  * @throws Exception\ExceptionInterface
  */
 protected function internalDecrementItem(&$normalizedKey, &$value)
 {
     $options = $this->getOptions();
     $prefix = $options->getNamespace() . $options->getNamespaceSeparator();
     $internalKey = $prefix . $normalizedKey;
     $value = (int) $value;
     $newValue = apc_dec($internalKey, $value);
     // initial value
     if ($newValue === false) {
         $ttl = $options->getTtl();
         $newValue = -$value;
         if (!apc_add($internalKey, $newValue, $ttl)) {
             throw new Exception\RuntimeException("apc_add('{$internalKey}', {$newValue}, {$ttl}) failed");
         }
     }
     return $newValue;
 }
开发者ID:haoyanfei,项目名称:zf2,代码行数:25,代码来源:Apc.php

示例10: dec

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

示例11: decrement

 /**
  * @inheritdoc
  */
 public function decrement($key, $offset = 1, $expire = 0, $create = true)
 {
     $hash = $this->prepareKey($key);
     if ($this->exists($key) === false) {
         if ($create === false) {
             return false;
         }
         apc_add($hash, 0, $expire);
     }
     return apc_dec($hash, $offset);
 }
开发者ID:romeoz,项目名称:rock-cache,代码行数:14,代码来源:APC.php

示例12: dec

 public function dec($key, $interval = 1)
 {
     return apc_dec($this->_p($key), $interval);
 }
开发者ID:radiosilence,项目名称:ham,代码行数:4,代码来源:ham.php

示例13: decrement

 /**
  * Decrements the value of an integer cached key
  *
  * @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 apc_dec($key, $offset);
 }
开发者ID:hupla78,项目名称:Nadia,代码行数:11,代码来源:ApcEngine.php

示例14: decrement

 /**
  * {@inheritdoc}
  */
 public function decrement($counter, $number = 1)
 {
     $counter = $this->transform($counter);
     $value = apc_dec($this->prefix . '/' . $counter->getName(), $number);
     return $this->handleDecrement($value, $counter, $number);
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:9,代码来源:ApcCounter.php

示例15: decrement

 /**
  * Performs an atomic decrement operation on specified numeric cache item.
  *
  * Note that, as per the APC specification:
  * If the item's value is not numeric, the decrement operation has no effect
  * on the key - it retains it's original non-integer value.
  *
  * @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) {
         return apc_dec($params['key'], $offset);
     };
 }
开发者ID:EHER,项目名称:monopolis,代码行数:17,代码来源:Apc.php


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