1 | <?php |
||
11 | class Backup extends BackupAbstract |
||
12 | { |
||
13 | /** |
||
14 | * Export database to file. |
||
15 | * |
||
16 | * @param string $filename |
||
17 | * |
||
18 | * @throws BackupExportException|BackupException |
||
19 | * |
||
20 | * @return bool |
||
21 | */ |
||
22 | public function export($filename = null): bool |
||
56 | |||
57 | /** |
||
58 | * Restore database from file path. |
||
59 | * |
||
60 | * @param string $filepath |
||
61 | * |
||
62 | * @throws BackupRestoreException |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function restore($filepath): bool |
||
94 | |||
95 | /** |
||
96 | * Is a file compressed? |
||
97 | * |
||
98 | * @param string $filepath |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | protected function isCompressed($filepath): bool |
||
106 | |||
107 | /** |
||
108 | * Remove temporary files. |
||
109 | * |
||
110 | * @param string $filepath |
||
111 | * @param bool $force |
||
112 | * |
||
113 | * @return void |
||
114 | */ |
||
115 | protected function removeTemporaryFiles($filepath, $force = false): void |
||
121 | |||
122 | /** |
||
123 | * Compress a file with gzip. |
||
124 | * |
||
125 | * @param string $filepath |
||
126 | * |
||
127 | * @throws BackupException |
||
128 | * |
||
129 | * @return string |
||
130 | */ |
||
131 | protected function compressFile($filepath): string |
||
143 | |||
144 | /** |
||
145 | * Decompress a file with gzip. |
||
146 | * |
||
147 | * @param string $filepath |
||
148 | * |
||
149 | * @throws BackupException |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | protected function decompressFile($filepath): string |
||
164 | |||
165 | /** |
||
166 | * Get an compressed filepath from a uncompressed filepath. |
||
167 | * |
||
168 | * @param string $filepath |
||
169 | * |
||
170 | * @return string |
||
171 | */ |
||
172 | protected function getCompressedFilepath($filepath): string |
||
176 | |||
177 | /** |
||
178 | * Get an uncompressed filepath from a compressed filepath. |
||
179 | * |
||
180 | * @param string $filepath |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | protected function getUncompressedFilepath($filepath): string |
||
188 | |||
189 | /** |
||
190 | * Get database restoration files. |
||
191 | * |
||
192 | * @param string $path |
||
193 | * |
||
194 | * @throws BackupException |
||
195 | * |
||
196 | * @return array |
||
197 | */ |
||
198 | public function getRestorationFiles($path = null): array |
||
231 | |||
232 | /** |
||
233 | * Get database process output. |
||
234 | * |
||
235 | * @return string |
||
236 | */ |
||
237 | public function getProcessOutput(): string |
||
241 | } |
||
242 |