1 | <?php |
||
11 | class Filesystem |
||
12 | { |
||
13 | /** |
||
14 | * @var BaseFilesystem |
||
15 | */ |
||
16 | private static $delegate; |
||
17 | |||
18 | /** |
||
19 | * Creates a directory recursively. |
||
20 | * |
||
21 | * @param string|array|\Traversable $dirs The directory path |
||
22 | * @param int $mode The directory mode |
||
23 | * |
||
24 | * @throws IOException On any directory creation failure |
||
25 | */ |
||
26 | public static function mkdir($dirs, int $mode = 0777) |
||
30 | |||
31 | /** |
||
32 | * Checks the existence of files or directories. |
||
33 | * |
||
34 | * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check |
||
35 | * |
||
36 | * @return bool true if the file exists, false otherwise |
||
37 | */ |
||
38 | 14 | public static function exists($files): bool |
|
42 | |||
43 | /** |
||
44 | * Removes files or directories. |
||
45 | * |
||
46 | * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove |
||
47 | * |
||
48 | * @throws IOException When removal fails |
||
49 | */ |
||
50 | public static function remove($files) |
||
54 | |||
55 | /** |
||
56 | * Atomically dumps content into a file. |
||
57 | * |
||
58 | * @param string $filename The file to be written to |
||
59 | * @param string $content The data to write into the file |
||
60 | * |
||
61 | * @throws IOException If the file cannot be written to |
||
62 | */ |
||
63 | 97 | public static function dumpFile(string $filename, string $content) |
|
67 | |||
68 | /** |
||
69 | * @return BaseFilesystem |
||
70 | */ |
||
71 | 97 | public static function getDelegate(): BaseFilesystem |
|
79 | } |
||
80 |