1 | <?php |
||
30 | class Redis extends KeyValueStorage |
||
31 | { |
||
32 | /** @var Client */ |
||
33 | protected $redis; |
||
34 | |||
35 | /** |
||
36 | * @param array $servers |
||
37 | */ |
||
38 | public function __construct(array $servers) |
||
46 | |||
47 | /** |
||
48 | * Read values for a set of keys from cache |
||
49 | * |
||
50 | * @param array $keys list of keys to fetch |
||
51 | * |
||
52 | * @return array list of values with the given keys used as indexes |
||
53 | */ |
||
54 | protected function read(array $keys) |
||
64 | |||
65 | /** |
||
66 | * Save values for a set of keys to cache |
||
67 | * |
||
68 | * @param array $keys list of values to save |
||
69 | * @param int $expire expiration time |
||
70 | * |
||
71 | * @return bool true on success, false on failure |
||
72 | */ |
||
73 | protected function write(array $keys, $expire = 1) |
||
81 | |||
82 | /** |
||
83 | * Remove values from cache |
||
84 | * |
||
85 | * @param array $keys list of keys to delete |
||
86 | * |
||
87 | * @return bool true on success, false on failure |
||
88 | */ |
||
89 | protected function delete(array $keys) |
||
97 | |||
98 | /** |
||
99 | * Remove *all* values from cache |
||
100 | * |
||
101 | * @return bool true on success, false on failure |
||
102 | */ |
||
103 | protected function purge() |
||
107 | } |
||
108 |