FileStore::increment PHP Method

increment() public method

自增
public increment ( string $key ) : boolean | multitype:
$key string
return boolean | multitype:
    public function increment($key)
    {
        flock($this->dataFileHandle, LOCK_EX);
        $val = $this->get($key);
        $val = !$val ? 1 : ++$val;
        file_put_contents(\Config\Store::$storePath . '/' . $key, serialize($val));
        flock($this->dataFileHandle, LOCK_UN);
        return $val;
    }