1 | <?php |
||
24 | class Restore extends Process |
||
25 | { |
||
26 | /** |
||
27 | * Restore all backups |
||
28 | * |
||
29 | * @param \phpbu\App\Configuration $configuration |
||
30 | * @return \phpbu\App\Result |
||
31 | * @throws \Exception |
||
32 | */ |
||
33 | 3 | public function run(Configuration $configuration) : Result |
|
43 | |||
44 | /** |
||
45 | * Collects all restore commands in a restore plan |
||
46 | * |
||
47 | * @param \phpbu\App\Configuration\Backup $backup |
||
48 | * @return \phpbu\App\Backup\Restore\Plan |
||
49 | * @throws \phpbu\App\Exception |
||
50 | */ |
||
51 | 3 | private function createRestorePlan(Configuration\Backup $backup): Plan |
|
60 | |||
61 | /** |
||
62 | * Output the restore plan |
||
63 | * |
||
64 | * @param \phpbu\App\Backup\Restore\Plan $plan |
||
65 | */ |
||
66 | 3 | private function printPlan(Plan $plan) |
|
71 | |||
72 | /** |
||
73 | * @param \phpbu\App\Backup\Target $target |
||
74 | * @param \phpbu\App\Configuration\Backup $backup |
||
75 | * @param \phpbu\App\Backup\Restore\Plan $plan |
||
76 | * @throws \phpbu\App\Exception |
||
77 | */ |
||
78 | 3 | private function decryptBackup(Target $target, Configuration\Backup $backup, Plan $plan) |
|
93 | |||
94 | /** |
||
95 | * @param \phpbu\App\Backup\Target $target |
||
96 | * @param \phpbu\App\Configuration\Backup $backup |
||
97 | * @param \phpbu\App\Backup\Restore\Plan $plan |
||
98 | * @throws \phpbu\App\Exception |
||
99 | */ |
||
100 | 3 | private function restoreBackup(Target $target, Configuration\Backup $backup, Plan $plan) |
|
129 | |||
130 | /** |
||
131 | * Output the decryption commands |
||
132 | * |
||
133 | * @param \phpbu\App\Backup\Restore\Plan $plan |
||
134 | * @return void |
||
135 | */ |
||
136 | 3 | private function printDecryptionCommands(Plan $plan): void |
|
151 | |||
152 | /** |
||
153 | * Output the restore commands |
||
154 | * |
||
155 | * @param \phpbu\App\Backup\Restore\Plan $plan |
||
156 | * @return void |
||
157 | */ |
||
158 | 3 | private function printRestoreCommands(Plan $plan): void |
|
170 | |||
171 | /** |
||
172 | * Output extraction commands |
||
173 | * |
||
174 | * @param array $commands |
||
175 | * @return void |
||
176 | */ |
||
177 | 3 | private function printExtractionCommands(array $commands): void |
|
184 | |||
185 | /** |
||
186 | * Print restore plan commands |
||
187 | * |
||
188 | * @param array $commands |
||
189 | * @return void |
||
190 | */ |
||
191 | 3 | private function printCommands(array $commands): void |
|
201 | } |
||
202 |