MatthiasMullie\Scrapbook\Adapters\Flysystem::replace PHP 메소드

replace() 공개 메소드

public replace ( $key, $value, $expire )
    public function replace($key, $value, $expire = 0)
    {
        if (!$this->lock($key)) {
            return false;
        }
        if (!$this->exists($key)) {
            $this->unlock($key);
            return false;
        }
        $path = $this->path($key);
        $data = $this->wrap($value, $expire);
        try {
            $success = $this->filesystem->update($path, $data);
            return $success && $this->unlock($key);
        } catch (FileNotFoundException $e) {
            $this->unlock($key);
            return false;
        }
    }