diff --git a/README.md b/README.md index 1dbc887..637d9bc 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # Flysystem adapter for fallback filesystems - -[![Author](http://img.shields.io/badge/author-@castarco-blue.svg?style=flat-square)](https://twitter.com/castarco) -[![Build Status](https://img.shields.io/travis/Litipk/flysystem-fallback-adapter/master.svg?style=flat-square)](https://travis-ci.org/Litipk/flysystem-fallback-adapter) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/litipk/flysystem-fallback-adapter/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/litipk/flysystem-fallback-adapter) +[![Build Status](https://img.shields.io/travis/jenszahner/flysystem-fallback-adapter/master.svg?style=flat-square)](https://travis-ci.org/jenszahner/flysystem-fallback-adapter) +[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/jenszahner/flysystem-fallback-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/jenszahner/flysystem-fallback-adapter/code-structure) +[![Quality Score](https://img.shields.io/scrutinizer/g/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/jenszahner/flysystem-fallback-adapter) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Packagist Version](https://img.shields.io/packagist/v/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://packagist.org/packages/litipk/flysystem-fallback-adapter) -[![Total Downloads](https://img.shields.io/packagist/dt/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://packagist.org/packages/litipk/flysystem-fallback-adapter) +[![Packagist Version](https://img.shields.io/packagist/v/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://packagist.org/packages/jenszahner/flysystem-fallback-adapter) +[![Total Downloads](https://img.shields.io/packagist/dt/litipk/flysystem-fallback-adapter.svg?style=flat-square)](https://packagist.org/packages/jenszahner/flysystem-fallback-adapter) This adapter has been created to allow using a fallback filesystem for read operations when the files can't be accessed @@ -17,7 +15,7 @@ through the main adapter. ## Installation ```bash -composer require litipk/flysystem-fallback-adapter +composer require jenszahner/flysystem-fallback-adapter ``` ## Usage diff --git a/composer.json b/composer.json index f78b9da..3fedf19 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,17 @@ { - "name": "litipk/flysystem-fallback-adapter", + "name": "jenszahner/flysystem-fallback-adapter", "description": "Flysystem adapter for fallback filesystems", "license": "MIT", "authors": [ { - "name": "Andrés Correa Casablanca", - "email": "castarco@litipk.com" + "name": "Jens Zahner", + "email": "github+flysystem-adapter@zahner.mail" } ], "support": { - "email": "castarco@litipk.com", - "issues": "http://github.com/Litipk/flysystem-fallback-adapter/issues", - "source": "http://github.com/Litipk/flysystem-fallback-adapter" + "email": "github+flysystem-adapter@zahner.mail", + "issues": "http://github.com/jenszahner/flysystem-fallback-adapter/issues", + "source": "http://github.com/jenszahner/flysystem-fallback-adapter" }, "require": { "php": ">=5.4.0", diff --git a/src/FallbackAdapter.php b/src/FallbackAdapter.php index 7e9a076..3721c4d 100644 --- a/src/FallbackAdapter.php +++ b/src/FallbackAdapter.php @@ -218,10 +218,11 @@ public function has($path) */ public function read($path) { - $result = $this->mainAdapter->read($path); - - if (false !== $result) { - return $result; + if ($this->mainAdapter->has($path)) { + $result = $this->mainAdapter->read($path); + if (false !== $result) { + return $result; + } } $result = $this->fallback->read($path); @@ -238,10 +239,12 @@ public function read($path) */ public function readStream($path) { - $result = $this->mainAdapter->readStream($path); - - if (false !== $result) { - return $result; + if ($this->mainAdapter->has($path)) { + $result = $this->mainAdapter->readStream($path); + + if (false !== $result) { + return $result; + } } $result = $this->fallback->readStream($path);