1 | <?php |
||
10 | class Filesystem |
||
11 | { |
||
12 | /** |
||
13 | * Determine if a file exists. |
||
14 | * |
||
15 | * @param string $path |
||
16 | * |
||
17 | * @return bool |
||
18 | */ |
||
19 | public function exists($path) |
||
23 | |||
24 | /** |
||
25 | * Get the contents of a file. |
||
26 | * |
||
27 | * @param string $path |
||
28 | * |
||
29 | * @throws \Magister\Services\Contracts\Filesystem\FileNotFoundException |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | public function get($path) |
||
41 | |||
42 | /** |
||
43 | * Get the returned value of a file. |
||
44 | * |
||
45 | * @param string $path |
||
46 | * |
||
47 | * @throws \Magister\Services\Contracts\Filesystem\FileNotFoundException |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public function getRequire($path) |
||
59 | |||
60 | /** |
||
61 | * Require the given file once. |
||
62 | * |
||
63 | * @param string $file |
||
64 | * |
||
65 | * @return mixed |
||
66 | */ |
||
67 | public function requireOnce($file) |
||
71 | |||
72 | /** |
||
73 | * Write the contents of a file. |
||
74 | * |
||
75 | * @param string $path |
||
76 | * @param string $contents |
||
77 | * @param bool $lock |
||
78 | * |
||
79 | * @return int |
||
80 | */ |
||
81 | public function put($path, $contents, $lock = false) |
||
85 | |||
86 | /** |
||
87 | * Prepend to a file. |
||
88 | * |
||
89 | * @param string $path |
||
90 | * @param string $data |
||
91 | * |
||
92 | * @return int |
||
93 | */ |
||
94 | public function prepend($path, $data) |
||
102 | |||
103 | /** |
||
104 | * Append to a file. |
||
105 | * |
||
106 | * @param string $path |
||
107 | * @param string $data |
||
108 | * |
||
109 | * @return int |
||
110 | */ |
||
111 | public function append($path, $data) |
||
115 | |||
116 | /** |
||
117 | * Delete the file at a given path. |
||
118 | * |
||
119 | * @param string|array $paths |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | public function delete($paths) |
||
137 | |||
138 | /** |
||
139 | * Move a file to a new location. |
||
140 | * |
||
141 | * @param string $path |
||
142 | * @param string $target |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function move($path, $target) |
||
150 | |||
151 | /** |
||
152 | * Copy a file to a new location. |
||
153 | * |
||
154 | * @param string $path |
||
155 | * @param string $target |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | public function copy($path, $target) |
||
163 | |||
164 | /** |
||
165 | * Determine if the given path is a directory. |
||
166 | * |
||
167 | * @param string $directory |
||
168 | * |
||
169 | * @return bool |
||
170 | */ |
||
171 | public function isDirectory($directory) |
||
175 | |||
176 | /** |
||
177 | * Determine if the given path is writable. |
||
178 | * |
||
179 | * @param string $path |
||
180 | * |
||
181 | * @return bool |
||
182 | */ |
||
183 | public function isWritable($path) |
||
187 | |||
188 | /** |
||
189 | * Determine if the given path is a file. |
||
190 | * |
||
191 | * @param string $file |
||
192 | * |
||
193 | * @return bool |
||
194 | */ |
||
195 | public function isFile($file) |
||
199 | } |
||
200 |