1 | <?php |
||
9 | class FileStorage implements FileStorageInterface |
||
10 | { |
||
11 | /** |
||
12 | * Get all of the migration files in a given path. |
||
13 | * |
||
14 | * @param string $path |
||
15 | * |
||
16 | * @return array |
||
17 | */ |
||
18 | public function getMigrationFiles($path) |
||
35 | |||
36 | /** |
||
37 | * Require a file. |
||
38 | * |
||
39 | * @param $path |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function requireFile($path) |
||
47 | |||
48 | /** |
||
49 | * Create a directory if it does not exist. |
||
50 | * |
||
51 | * @param $dir |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | public function createDirIfItDoesNotExist($dir) |
||
61 | |||
62 | /** |
||
63 | * Get the content of a file. |
||
64 | * |
||
65 | * @param string $path |
||
66 | * |
||
67 | * @throws Exception |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getContent($path) |
||
79 | |||
80 | /** |
||
81 | * Write the contents of a file. |
||
82 | * |
||
83 | * @param string $path |
||
84 | * @param string $contents |
||
85 | * @param bool $lock |
||
86 | * |
||
87 | * @return int |
||
88 | */ |
||
89 | public function putContent($path, $contents, $lock = false) |
||
93 | |||
94 | /** |
||
95 | * Check if file exists. |
||
96 | * |
||
97 | * @param string $path |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | public function exists($path) |
||
105 | |||
106 | /** |
||
107 | * Delete file. |
||
108 | * |
||
109 | * @param string $path |
||
110 | * |
||
111 | * @return bool |
||
112 | */ |
||
113 | public function delete($path) |
||
117 | |||
118 | /** |
||
119 | * Move file. |
||
120 | * |
||
121 | * @param string $path_from |
||
122 | * @param string $path_to |
||
123 | * |
||
124 | * @return bool |
||
125 | */ |
||
126 | public function move($path_from, $path_to) |
||
130 | } |
||
131 |