public function increment($key, $offset = 1)
    {
        $filePath = $this->getFilePathFromKey($key);

        if (!file_exists($filePath)) {
            return false;
        }

        if (!is_readable($filePath)) {
            return false;
        }

        $cacheFileData = file_get_contents($filePath);

        if ($this->config['gzipCompression']) {
            $cacheFileData = gzuncompress($cacheFileData);
        }

        $cacheObj = json_decode($cacheFileData);
        $content = $cacheObj->content;

        if ($unserializedContent = @unserialize($content)) {
            $content = $unserializedContent;
        }

        if (!$content || !is_numeric($content)) {
            return false;
        }

        $content += $offset;

        return $this->set($key, $content, $cacheObj->expiryTimestamp);
    }
public function increment($key, $offset = 1)
    {
        $filePath = $this->getFilePathFromKey($key);

        if (!file_exists($filePath)) {
            return false;
        }

        if (!is_readable($filePath)) {
            return false;
        }

        $cacheFileData = file_get_contents($filePath);

        if ($this->config['gzipCompression']) {
            $cacheFileData = gzuncompress($cacheFileData);
        }

        $cacheObj = json_decode($cacheFileData);
        $content = $cacheObj->content;

        if ($unserializedContent = @unserialize($content)) {
            $content = $unserializedContent;
        }

        if (!$content || !is_numeric($content)) {
            return false;
        }

        $content += $offset;

        return $this->set($key, $content, $cacheObj->expiryTimestamp);
    }
public function increment ( $ key , $ offset = 1 ) { $ filePath = $ this -> getFilePathFromKey ( $ key ) ; if ( ! file_exists ( $ filePath ) ) { return false ; } if ( ! is_readable ( $ filePath ) ) { return false ; } $ cacheFileData = file_get_contents ( $ filePath ) ; if ( $ this -> config [ 'gzipCompression' ] ) { $ cacheFileData = gzuncompress ( $ cacheFileData ) ; } $ cacheObj = json_decode ( $ cacheFileData ) ; $ content = $ cacheObj -> content ; if ( $ unserializedContent = @ unserialize ( $ content ) ) { $ content = $ unserializedContent ; } if ( ! $ content || ! is_numeric ( $ content ) ) { return false ; } $ content += $ offset ; return $ this -> set ( $ key , $ content , $ cacheObj -> expiryTimestamp ) ; }
Increments a value within the cache.

@param string $key
@param int    $offset

@return bool
Increments a value within the cache .