@@ 251-265 (lines=15) @@ | ||
248 | * |
|
249 | * @param string $filePath |
|
250 | */ |
|
251 | public function setBackupPath($filePath) |
|
252 | { |
|
253 | $path = realpath(dirname($filePath)); |
|
254 | if (!is_dir($path)) { |
|
255 | throw new FilesystemException(sprintf( |
|
256 | 'The backup directory does not exist: %s.', $path |
|
257 | )); |
|
258 | } |
|
259 | if (!is_writable($path)) { |
|
260 | throw new FilesystemException(sprintf( |
|
261 | 'The backup directory is not writeable: %s.', $path |
|
262 | )); |
|
263 | } |
|
264 | $this->backupPath = $filePath; |
|
265 | } |
|
266 | ||
267 | /** |
|
268 | * Get backup path for old phar versions |
|
@@ 282-296 (lines=15) @@ | ||
279 | * |
|
280 | * @param string $filePath |
|
281 | */ |
|
282 | public function setRestorePath($filePath) |
|
283 | { |
|
284 | $path = realpath(dirname($filePath)); |
|
285 | if (!file_exists($path)) { |
|
286 | throw new FilesystemException(sprintf( |
|
287 | 'The restore phar does not exist: %s.', $path |
|
288 | )); |
|
289 | } |
|
290 | if (!is_readable($path)) { |
|
291 | throw new FilesystemException(sprintf( |
|
292 | 'The restore file is not readable: %s.', $path |
|
293 | )); |
|
294 | } |
|
295 | $this->restorePath = $filePath; |
|
296 | } |
|
297 | ||
298 | /** |
|
299 | * Get path for the backup phar to rollback/restore from |