1 | <?php |
||
7 | class FsStorage implements Storage |
||
8 | { |
||
9 | 2 | public function exists(string $filename): bool |
|
13 | |||
14 | 2 | public function get(string $filename): string |
|
15 | { |
||
16 | 2 | $contents = file_get_contents($filename); |
|
17 | 2 | if ($contents === false) { |
|
18 | throw new RuntimeException('Could not read ' . $filename); |
||
19 | } |
||
20 | 2 | return $contents; |
|
21 | } |
||
22 | |||
23 | 3 | public function put(string $filename, string $contents): bool |
|
27 | |||
28 | 2 | public function remove(string $filename): bool |
|
32 | |||
33 | 1 | public function touch(string $filename, int $mtime): bool |
|
37 | |||
38 | 2 | public function getMtime(string $filename): int |
|
47 | } |
||
48 |