1 | <?php namespace Cornford\Backup; |
||
5 | class BackupFilesystem implements BackupFilesystemInterface { |
||
6 | |||
7 | const OS_UNKNOWN = 1; |
||
8 | const OS_WIN = 2; |
||
9 | const OS_LINUX = 3; |
||
10 | const OS_OSX = 4; |
||
11 | |||
12 | /** |
||
13 | * Check path exists. |
||
14 | * |
||
15 | * @param string $path |
||
16 | * |
||
17 | * @return boolean |
||
18 | */ |
||
19 | public function checkPathExists($path) |
||
27 | |||
28 | /** |
||
29 | * Check file exists. |
||
30 | * |
||
31 | * @param string $filepath |
||
32 | * |
||
33 | * @return boolean |
||
34 | */ |
||
35 | public function checkFileExists($filepath) |
||
47 | |||
48 | /** |
||
49 | * Check if file is empty. |
||
50 | * |
||
51 | * @param string $filepath |
||
52 | * |
||
53 | * @return boolean |
||
54 | */ |
||
55 | public function checkFileEmpty($filepath) |
||
59 | |||
60 | /** |
||
61 | * Remove file. |
||
62 | * |
||
63 | * @param string $filepath |
||
64 | * |
||
65 | * @return void |
||
66 | */ |
||
67 | public function removeFile($filepath) |
||
71 | |||
72 | /** |
||
73 | * Write a compressed file. |
||
74 | * |
||
75 | * @param string $compressedFilepath |
||
76 | * @param string $filepath |
||
77 | * |
||
78 | * @return void |
||
79 | */ |
||
80 | public function writeCompressedFile($compressedFilepath, $filepath) |
||
86 | |||
87 | /** |
||
88 | * Write an uncompressed file. |
||
89 | * |
||
90 | * @param string $uncompressedFilepath |
||
91 | * @param string $filepath |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function writeUncompressedFile($uncompressedFilepath, $filepath) |
||
101 | |||
102 | /** |
||
103 | * Get the operating system. |
||
104 | * |
||
105 | * @return integer |
||
106 | */ |
||
107 | public function getOperatingSystem() |
||
120 | |||
121 | /** |
||
122 | * Locate command location. |
||
123 | * |
||
124 | * @param string $command |
||
125 | * |
||
126 | * @return string|false |
||
127 | */ |
||
128 | public function locateCommand($command) |
||
154 | |||
155 | /** |
||
156 | * Check a function exists. |
||
157 | * |
||
158 | * @param string $function |
||
159 | * |
||
160 | * @return boolean |
||
161 | */ |
||
162 | public function checkFunctionExists($function) |
||
166 | |||
167 | } |