@@ 61-72 (lines=12) @@ | ||
58 | /** |
|
59 | * {@inheritdoc} |
|
60 | */ |
|
61 | protected function getDirectoryForBackup(BackupInterface $backup) |
|
62 | { |
|
63 | $backupDirectory = $this->directory . DIRECTORY_SEPARATOR . $backup->getName(); |
|
64 | ||
65 | try { |
|
66 | $this->filesystem->mkdir($backupDirectory); |
|
67 | } catch (\Exception $e) { |
|
68 | throw new DestinationException(sprintf('Unable to create backup directory "%s" for backup "%s" in local destination.', $backupDirectory, $backup->getName())); |
|
69 | } |
|
70 | ||
71 | return $backupDirectory; |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * {@inheritdoc} |
|
@@ 134-143 (lines=10) @@ | ||
131 | /** |
|
132 | * {@inheritdoc} |
|
133 | */ |
|
134 | protected function removeFile($backupDirectory, FileInterface $backupFile) |
|
135 | { |
|
136 | $path = $backupDirectory . DIRECTORY_SEPARATOR . $backupFile->getRelativePath(); |
|
137 | ||
138 | try { |
|
139 | $this->filesystem->remove($path); |
|
140 | } catch (\Exception $e) { |
|
141 | throw new DestinationException(sprintf('Unable to cleanup backup destination "%s" after backup process, file "%s" could not be removed.', $backupDirectory, $path), 0, $e); |
|
142 | } |
|
143 | } |
|
144 | ||
145 | /** |
|
146 | * {@inheritdoc} |