Coder-Spirit / flysystem-fallback-adapter

Flysystem adapter for fallback filesystems
17 stars 5 forks source link

Last PR triggers errors when file does not exists in system. #4

Open ulinskas opened 6 years ago

ulinskas commented 6 years ago

This PR https://github.com/Litipk/flysystem-fallback-adapter/pull/2 created issue, you should revert these changes.

How it was before:

if ($this->mainAdapter->has($path)) {
    return $this->mainAdapter->read($path);
}

How it is now:

$result = $this->mainAdapter->read($path);
if (false !== $result) {
    return $result;
}

I agree that this changes save some performance. But now, you get warning if file does not exists in system (If errors are not suppressed)

thomasvargiu commented 5 years ago

Same for readStream. When you have the local adapter, trying to call fopen() with not existing file throws an error.

stephanvierkant commented 5 years ago

I already created a PR (#3) to revert this change (#2), mentioned in #1.

For now, you can use version 0.1.2.