1 | <?php |
||
18 | class Plan |
||
19 | { |
||
20 | /** |
||
21 | * List of commands to execute to restore the backup |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | private $commands = [ |
||
26 | 'decrypt' => [], |
||
27 | 'decompress' => [], |
||
28 | 'restore' => [] |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * Is used crypt supported |
||
33 | * |
||
34 | * @var bool |
||
35 | */ |
||
36 | private $supportedCrypt = true; |
||
37 | |||
38 | /** |
||
39 | * Is used source supported |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | private $supportedSource = true; |
||
44 | |||
45 | /** |
||
46 | * Mark the crypt implementation as not supported to restore |
||
47 | * |
||
48 | * @return void |
||
49 | */ |
||
50 | 1 | public function markCryptAsUnsupported(): void |
|
54 | |||
55 | /** |
||
56 | * Does crypt support restore |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | 3 | public function isCryptSupported(): bool |
|
64 | |||
65 | /** |
||
66 | * Add a decryption command to the restore plan |
||
67 | * |
||
68 | * @param string $command |
||
69 | * @return void |
||
70 | */ |
||
71 | 3 | public function addDecryptionCommand(string $command): void |
|
75 | |||
76 | /** |
||
77 | * Return the list of decryption commands |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | 5 | public function getDecryptionCommands(): array |
|
85 | |||
86 | /** |
||
87 | * Add an decompression command to the restore plan |
||
88 | * |
||
89 | * @param string $command |
||
90 | * @return void |
||
91 | */ |
||
92 | 1 | public function addDecompressionCommand(string $command): void |
|
96 | |||
97 | /** |
||
98 | * Return the list of decompression commands |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | 5 | public function getDecompressionCommands(): array |
|
106 | |||
107 | /** |
||
108 | * Mark used source as unsupported to restore |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public function markSourceAsUnsupported(): void |
||
113 | { |
||
114 | $this->supportedSource = false; |
||
115 | } |
||
116 | |||
117 | /** |
||
118 | * Does the source support restore |
||
119 | * |
||
120 | * @return bool |
||
121 | */ |
||
122 | 3 | public function isSourceSupported(): bool |
|
126 | |||
127 | /** |
||
128 | * Add restore command to the restore plan |
||
129 | * |
||
130 | * @param string $command |
||
131 | * @return void |
||
132 | */ |
||
133 | 2 | public function addRestoreCommand(string $command): void |
|
137 | |||
138 | /** |
||
139 | * Return the list of restore commands |
||
140 | * |
||
141 | * @return array |
||
142 | */ |
||
143 | 5 | public function getRestoreCommands(): array |
|
147 | } |
||
148 |