1 | <?php |
||
22 | class Source |
||
23 | { |
||
24 | /** |
||
25 | * Executes the backup and compression. |
||
26 | * |
||
27 | * @param \phpbu\App\Backup\Source $source |
||
28 | * @param \phpbu\App\Backup\Target $target |
||
29 | * @param \phpbu\App\Result $result |
||
30 | * @throws \phpbu\App\Exception |
||
31 | */ |
||
32 | public function run(SourceExe $source, Target $target, Result $result) |
||
41 | |||
42 | /** |
||
43 | * Handle directory compression for sources which can't handle compression by them self. |
||
44 | * |
||
45 | * @param \phpbu\App\Backup\Target $target |
||
46 | * @param \phpbu\App\Result $result |
||
47 | * @param string $dataToCompress |
||
48 | * @throws \phpbu\App\Exception |
||
49 | */ |
||
50 | protected function handleCompression(Target $target, Result $result, $dataToCompress) |
||
60 | |||
61 | /** |
||
62 | * Compresses the target if the target is a directory. |
||
63 | * |
||
64 | * @param \phpbu\App\Backup\Target $target |
||
65 | * @param \phpbu\App\Result $result |
||
66 | * @param string $dataToCompress |
||
67 | * @throws \phpbu\App\Exception |
||
68 | */ |
||
69 | protected function compressDirectory(Target $target, Result $result, $dataToCompress) |
||
80 | |||
81 | /** |
||
82 | * Compresses the target if the target is a single file. |
||
83 | * |
||
84 | * @param \phpbu\App\Backup\Target $target |
||
85 | * @param \phpbu\App\Result $result |
||
86 | * @param string $dataToCompress |
||
87 | * @throws \phpbu\App\Exception |
||
88 | */ |
||
89 | protected function compressFile(Target $target, Result $result, $dataToCompress) |
||
94 | } |
||
95 |