Increment the counter for a given key for a given decay time.

@param  string  $key
@param  float|int  $decayMinutes
@return int
160660
public function track($key, $decayMinutes = 1)
    {
        $this->cache->add($key, 1, $decayMinutes);

        return (int) $this->cache->increment($key);
    }
190521
public function count($key)
    {
        $key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;

        return (int) $this->getRedisClient()->bitcount($key);
    }
1199810
public function lock($key, $timeout = self::EXPIRE): bool
    {
        $wait = 20000;
        $totalWait = 0;
        $time = $timeout * 1000000;
        $key = self::PREFIX . $key;

        while ($totalWait < $time && false === $this->mem->add($key, 1, $timeout)) {
            usleep($wait);
            $totalWait += $wait;
        }

        if ($totalWait >= $time) {
            throw new \RuntimeException('cannot get lock for waiting ' . $timeout . 's.', __LINE__);
        }

        return true;
    }
1091347
public function expire(Memento\Key $key = null)
    {
        $this->__connect($key);
        $expiresKey = $this->groupKey ? $this->groupKey : $key;
        $this->redis->hset($expiresKey->getKey(), Memento\Hash::FIELD_EXPIRES, 0);

        return (0 === intval($this->redis->hget($expiresKey->getKey(), Memento\Hash::FIELD_EXPIRES)));
    }
709123
public function increment($key, $incvalue = 1) {
        $used_key = $this->getUsedKey($key);
        $val = $this->get($key);
        if ($val === null || !is_numeric($val) || !is_numeric($incvalue)) {
            return false;
        }
        if (intval($val) == $val) {
            return $this->redis->incr($used_key, intval($incvalue));
        }
        else { // float values
            $result = intval($val)+intval($incvalue);
            if($this->redis->set($used_key, $result)) {
                return $result;
            }
            return false;
        }
    }
620746
public function expire($key, $seconds)
    {
        Util::checkArgString($key);
        Util::checkArgInteger($seconds);

        try {
            return $this->getAdapter()->expire($key, $seconds);
        } catch (\Exception $e) {
            throw new InternalException($e->getMessage(), $e->getCode(), $e);
        }
    }
72083
public function increment($key, $offset = 1)
    {
        if (!$this->read($key)) {
            $this->write($key, 0);
        }
        $key = $this->_key($key);
        $this->data[$key]['val'] += $offset;

        return $this->data[$key]['val'];
    }
1350093
public function incrby($key, $increment = 1)
    {
        $this->init();
        return $this->driver->incrby($key, (int)$increment);
    }
474677
public function increment($key, $value = 1)
    {
        if ($this->exists($key)) {
            return self::$redis->incrBy($key, $value);
        } else {
            $this->set($key, $value);

            return $value;
        }
    }
1138533
protected function addResult($key, $increment = 1)
    {
        if (!array_key_exists($key, $this->results)) {
            $this->results[$key] = 0;
        }
        $this->results[$key] += $increment;
        return $this;
    }
488035
public function decrement($key, $offset = 1)
    {
        $key = $this->_key($key);

        return xcache_dec($key, $offset);
    }
650806
public function remember($minutes, $key = null)
    {
        list($this->cacheMinutes, $this->cacheKey) = array($minutes, $key);

        return $this;
    }
188538
public function increment($key, $value = 1)
    {
        return $this->incrementOrDecrement($key, $value, function ($current, $value) {
            return $current + $value;
        });
    }
134096
public function decrement($key, $offset = 1)
    {
        $key = $this->_key($key);

        return apcu_dec($key, $offset);
    }
1159954
public function decrement($key, $steps = 1)
    {
        $key = "integer-store::$key";

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

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

        return $this->cache[$key];
    }
876571
public function increment($key, $val = 1)
    {
        $this->lock = true;
        $v = $this->get($key);
        if (is_int($v)) {
            return $this->update($key, $v + abs(intval($val)));
        } else {
            $this->set($key, 1);
            return 1;
        }
    }
554896
public function expire($key, $seconds)
    {
        $this->init();
        $result = $this->driver->expire($key, $seconds);
        return (bool)$result;
    }