1 | <?php |
||
29 | class Driver_File extends Base |
||
30 | { |
||
31 | /** |
||
32 | * Stores the cache directory |
||
33 | **/ |
||
34 | private $_dir = ''; |
||
35 | |||
36 | /** |
||
37 | * Files to exclude for stats |
||
38 | **/ |
||
39 | private $_exclude = ['info.txt']; |
||
40 | |||
41 | /** |
||
42 | * Creates the cache handler object |
||
43 | * |
||
44 | * @param array $config Configuration details as an array |
||
45 | * |
||
46 | * @throws \Exception |
||
47 | * |
||
48 | * @return \csphere\core\cache\Driver_File |
||
49 | **/ |
||
50 | |||
51 | public function __construct(array $config) |
||
62 | |||
63 | /** |
||
64 | * Clears the cache content |
||
65 | * |
||
66 | * @return boolean |
||
67 | **/ |
||
68 | public function clear() |
||
81 | |||
82 | /** |
||
83 | * Removes a cached key |
||
84 | * |
||
85 | * @param string $key Name of the key |
||
86 | * @param int $ttl Time to life used for the key |
||
87 | * |
||
88 | * @return boolean |
||
89 | **/ |
||
90 | |||
91 | public function delete($key, $ttl = 0) |
||
102 | |||
103 | /** |
||
104 | * Returns a formatted array with statistics |
||
105 | * |
||
106 | * @return array |
||
107 | **/ |
||
108 | |||
109 | public function info() |
||
124 | |||
125 | /** |
||
126 | * Returns a formatted array with all keys and additional information |
||
127 | * |
||
128 | * @return array |
||
129 | **/ |
||
130 | |||
131 | public function keys() |
||
150 | |||
151 | /** |
||
152 | * Fetches the desired key |
||
153 | * |
||
154 | * @param string $key Name of the key |
||
155 | * @param int $ttl Time to life used for the key |
||
156 | * |
||
157 | * @return array |
||
158 | **/ |
||
159 | |||
160 | public function load($key, $ttl = 0) |
||
175 | |||
176 | /** |
||
177 | * Stores the key with its value in the cache |
||
178 | * |
||
179 | * @param string $key Name of the key |
||
180 | * @param array $value Content to be stored |
||
181 | * @param int $ttl Time to life used for the key |
||
182 | * |
||
183 | * @return boolean |
||
184 | **/ |
||
185 | |||
186 | public function save($key, $value, $ttl = 0) |
||
209 | } |
||
210 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.