1 | <?php |
||
12 | class FileStore implements StoreInterface |
||
13 | { |
||
14 | /** |
||
15 | * Path to directory where cache files will be saved. |
||
16 | */ |
||
17 | protected $path; |
||
18 | |||
19 | /** |
||
20 | * Creates a File store |
||
21 | * |
||
22 | * @param string |
||
23 | */ |
||
24 | public function __construct($path) |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | public function add($key, $value, $ttl = 0) |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function set($key, $value, $ttl = 0) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function get($key) |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | public function has($key) |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function delete($key) |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function flush() |
||
106 | |||
107 | /** |
||
108 | * Generates a filename based on the $key parameter |
||
109 | * |
||
110 | * @param string $key |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | protected function filename($key) |
||
118 | } |
||
119 |
If you suppress an error, we recommend checking for the error condition explicitly: