1 | <?php |
||
29 | class Driver_Redis extends Base |
||
30 | { |
||
31 | /** |
||
32 | * Redis object |
||
33 | **/ |
||
34 | private $_redis = null; |
||
35 | |||
36 | /** |
||
37 | * Creates the cache handler object |
||
38 | * |
||
39 | * @param array $config Configuration details as an array |
||
40 | * |
||
41 | * @throws \Exception |
||
42 | * |
||
43 | * @return \csphere\core\cache\Driver_Redis |
||
44 | **/ |
||
45 | |||
46 | public function __construct(array $config) |
||
78 | |||
79 | /** |
||
80 | * Clears the cache content |
||
81 | * |
||
82 | * @return boolean |
||
83 | **/ |
||
84 | |||
85 | public function clear() |
||
91 | |||
92 | /** |
||
93 | * Removes a cached key |
||
94 | * |
||
95 | * @param string $key Name of the key |
||
96 | * @param int $ttl Time to life used for the key |
||
97 | * |
||
98 | * @return boolean |
||
99 | **/ |
||
100 | |||
101 | public function delete($key, $ttl = 0) |
||
112 | |||
113 | /** |
||
114 | * Returns a formatted array with statistics |
||
115 | * |
||
116 | * @return array |
||
117 | **/ |
||
118 | |||
119 | public function info() |
||
132 | |||
133 | /** |
||
134 | * Returns a formatted array with all keys and additional information |
||
135 | * |
||
136 | * @return array |
||
137 | **/ |
||
138 | |||
139 | public function keys() |
||
172 | |||
173 | /** |
||
174 | * Fetches the desired key |
||
175 | * |
||
176 | * @param string $key Name of the key |
||
177 | * @param int $ttl Time to life used for the key |
||
178 | * |
||
179 | * @return array |
||
180 | **/ |
||
181 | |||
182 | public function load($key, $ttl = 0) |
||
193 | |||
194 | /** |
||
195 | * Stores the key with its value in the cache |
||
196 | * |
||
197 | * @param string $key Name of the key |
||
198 | * @param array $value Content to be stored |
||
199 | * @param int $ttl Time to life used for the key |
||
200 | * |
||
201 | * @return boolean |
||
202 | **/ |
||
203 | |||
204 | public function save($key, $value, $ttl = 0) |
||
219 | } |
||
220 |
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.