Adapter::increment

Increment a raw value offset.

@param string $key  Cache item key.
@param int    $step Increment step to add.

@return mixed Returns the incremented value on success and FALSE on failure.
7985
public function increment($key, $step = 1)
    {
        $success = false;

        return wincache_ucache_inc($this->prefixKey . $key, $step, $success);
    }
521478
public function increment($key, $val = 1)
    {
        return apc_inc($this->conf['prefix'] . $key, abs(intval($val)));
    }
1066703
public function inc($key, $step = 1) {
        $key = $this->conf['keyPrefix'] . $key;
        X::logger()->trace("MCache inc $key by $step");
        return $this->cache->increment($key, $step);
    }
323439
public function decrement($key, $step)
    {
        $value = $this->getValueByKey($key, false);
        $this->alter($key, $value - $step);
    }
806577
public function nextStep($step = null)
    {
        $steps = $this->getStepsArray();
        $key = array_search($step, $steps);

        if (is_int($key) && $key < count($steps)-1) {
            return $steps[$key+1];
        }

        return false;
    }
278745
public function inc($key, $step = 1, &$success = null)
	{
		$result = $this->memcached->increment($key, $step);
		$success = ($result !== false);
		
		return $result;
	}
2371
public function increment($key, $steps = 1)
    {
        $previous = $this->has($key) ? $this->get($key) : 0;
        $previous += $steps;
        $this->put($key, $previous);

        return $previous;
    }
472849
public function decrement(string $key, int $step = 1): int {
		return $this->driver->decrby($key, $step);
	}
499336
public function increment($key, $step = 1)
    {
        if (!$this->enabled)
            return false;

        $has_replaced = $has_set = false;
        try {
            // Store the cache object
            $nKey = $this->key($key);
            $has_replaced = @$this->getConnection()->add($nKey, $step, 0);
            if (!$has_replaced) {
                $has_set = @$this->getConnection()->increment($nKey, $step);
            }

        } catch (Exception $e) {
            throw new CacheException($e->getMessage(), $e->getCode());
        }

        $this->Logger->debug("". (($has_replaced || $has_set) ? "Successfully" : "Failed to") . " increment key '{$key}'\n");
//        $this->Logger->debug($data);

        return $has_replaced ? $step : $has_set;
    }
1267441
public function decrement($key, $offset = 1)
    {
        return $this->memcached ? $this->memcached->decrement($key, $offset) : false;
    }
572913
public function decrement($key, $offset = 1)
    {
        $duration = $this->_config['duration'];
        $key = $this->_key($key);

        $value = (int)$this->_Redis->decrBy($key, $offset);
        if ($duration > 0) {
            $this->_Redis->setTimeout($key, $duration);
        }

        return $value;
    }
575899
public function increment($key, $steps = 1)
    {
        $key = "integer-store::$key";

        if (!isset($this->cache[$key])) {
            $this->cache[$key] = 0;
        }

        $this->cache[$key] += $steps;

        return $this->cache[$key];
    }
1355086
public function inc($name, $step = 1)
    {
        $key = $this->getCacheKey($name);
        if (self::$instance->get($key)) {
            return self::$instance->increment($key, $step);
        }

        return self::$instance->set($key, $step);
    }
1320223
public function increment($key, $val = 1)
    {
        return $this->hash($key)->incrBy($key, abs(intval($val)));
    }
834459
public function decrement($key, $step = 1)
    {
        $success = false;
        apcu_dec($this->prefixKey . $key, $step, $success);

        return $success;
    }
1253369
public function increment($key, $value = 1)
    {
        $cached = $this->get($key);

        if (is_numeric($cached)) {
            $cached += $value;
            $this->set($key, $cached);
			return $cached;
		}

        return false;
    }
814546
public function increment($id, $offset = 1)
	{
		return $this->{$this->_adapter}->increment($this->key_prefix.$id, $offset);
	}