diff --git a/src/Backup/Destination/Base.php b/src/Backup/Destination/Base.php index 3e45fdf..3ca5d2c 100644 --- a/src/Backup/Destination/Base.php +++ b/src/Backup/Destination/Base.php @@ -40,7 +40,11 @@ public function canAccess(); */ public function listContents($dir = '', $recursive = false); + /** + * @param string $file The path to the file. + * @return string|false The file contents or false on failure. + */ public function read($file); public function write($filename, $contents); -} \ No newline at end of file +} diff --git a/src/Backup/Destination/Local.php b/src/Backup/Destination/Local.php index fa4dd31..56ffa65 100644 --- a/src/Backup/Destination/Local.php +++ b/src/Backup/Destination/Local.php @@ -50,7 +50,11 @@ public function canAccess() public function read($file) { - return $this->filesystem->read($file); + try { + return $this->filesystem->read($file); + } catch (\League\Flysystem\FileNotFoundException $e) { + return false; + } } public function listContents($dir = '', $recursive = false) @@ -65,4 +69,4 @@ public function write($filename, $contents) } return $this->filesystem->put($filename, $contents); } -} \ No newline at end of file +} diff --git a/src/Backup/Tools/Tar.php b/src/Backup/Tools/Tar.php index bbfef17..0694e29 100644 --- a/src/Backup/Tools/Tar.php +++ b/src/Backup/Tools/Tar.php @@ -341,4 +341,4 @@ public function getOutput() { return $this->_output; } -} \ No newline at end of file +}