Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Backup/Destination/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
8 changes: 6 additions & 2 deletions src/Backup/Destination/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -65,4 +69,4 @@ public function write($filename, $contents)
}
return $this->filesystem->put($filename, $contents);
}
}
}
2 changes: 1 addition & 1 deletion src/Backup/Tools/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,4 @@ public function getOutput()
{
return $this->_output;
}
}
}