/** * {@inheritdoc} */ public function read(string $path) : string { if (!$this->has($path)) { throw new FileNotFoundException($path); } $content = $this->driver->read($path); return !$content ?: $content['contents']; }
/** * {@inheritDoc} */ public function readStream($pathOrUuid) { $path = $this->convertToPath($pathOrUuid); $this->guardNoInvalidUuid($pathOrUuid, $path); $this->guardInUploadPath($path); return $this->adapter->read($path); }
/** * Read a file. * * @param string $path path to file * * @throws FileNotFoundException * * @return string|false file contents or FALSE when fails * to read existing file */ public function read($path) { $path = Util::normalizePath($path); $this->assertPresent($path); if (!($object = $this->adapter->read($path))) { return false; } return $object['contents']; }
/** * {@inheritdoc} */ public function read($path) { $result = $this->mainAdapter->read($path); if (false !== $result) { return $result; } $result = $this->fallback->read($path); if (false !== $result && $this->forceCopyOnMain) { $this->mainAdapter->write($path, $result['contents'], new Config()); } return $result; }
/** * Read a file. * * @param string $path path to file * * @throws FileNotFoundException * * @return string|false file contents or FALSE when fails * to read existing file */ public function read($path) { $path = Util::normalizePath($path); $this->assertPresent($path); if ($contents = $this->cache->read($path)) { return $contents; } if (!($object = $this->adapter->read($path))) { return false; } $this->cache->updateObject($path, $object, true); return $object['contents']; }
/** * {@inheritdoc} */ public function read($path) { return $this->adapter->read($this->getPath($path)); }
function it_reads_file(AdapterInterface $adapter) { $adapter->read('filename')->willReturn(['contents' => 'Hello.']); $this->read('filename')->shouldReturn('Hello.'); }
/** * {@inheritdoc} */ public function read($path) { return $this->source->read($path); }
/** * {@inheritdoc} */ public function load() { if (($file = $this->adapter->read($this->file)) !== null) { $this->setFromStorage($file['contents']); } }
/** * {@inheritdoc} */ public function read($key) { return $this->adapter->read($key)['contents']; }