MatthiasMullie\Scrapbook\Adapters\Flysystem::read PHP Method

read() protected method

Fetch stored data from cache file.
protected read ( string $key ) : boolean | array
$key string
return boolean | array
    protected function read($key)
    {
        $path = $this->path($key);
        try {
            $data = $this->filesystem->read($path);
        } catch (FileNotFoundException $e) {
            // unlikely given previous 'exists' check, but let's play safe...
            // (outside process may have removed it since)
            return false;
        }
        if ($data === false) {
            // in theory, a file could still be deleted between Flysystem's
            // assertPresent & the time it actually fetched the content
            // extremely unlikely though
            return false;
        }
        $data = explode("\n", $data, 2);
        $data[0] = (int) $data[0];
        return $data;
    }