1 | <?php |
||
17 | class RedisCache extends TaggableCache |
||
18 | { |
||
19 | use MultiCacheTrait { |
||
20 | MultiCacheTrait::setItems as setItemsTrait; |
||
21 | } |
||
22 | |||
23 | const DEFAULT_HOST = '127.0.0.1'; |
||
24 | const DEFAULT_PORT = 6379; |
||
25 | const DEFAULT_DB = 0; |
||
26 | const DEFAULT_TIMEOUT = 0.0; |
||
27 | |||
28 | /** |
||
29 | * @var Redis |
||
30 | */ |
||
31 | private $client; |
||
32 | |||
33 | /** |
||
34 | * RedisCache constructor. |
||
35 | * |
||
36 | * @param Redis $client |
||
37 | */ |
||
38 | 1 | public function __construct(Redis $client) |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 1 | public function set($key, $value, $timeToLive = null) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 1 | public function setItems(array $items, $timeToLive = null) |
|
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | 1 | public function has($key) |
|
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | 1 | public function demand($key) |
|
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 1 | public function get($key, $default = null) |
|
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | 1 | public function getItems(array $keys) |
|
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | 1 | public function delete($key) |
|
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | 1 | public function deleteItems(array $keys) |
|
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | 1 | public function flush() |
|
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | 1 | public function getTimeToLive($key) |
|
149 | } |
||
150 |