Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class RedisCacheProvider implements CacheProvider{ |
||
8 | /** @var Redis */ |
||
9 | private $redis = null; |
||
10 | |||
11 | public function __construct($redis = null){ |
||
13 | } |
||
14 | |||
15 | public function set($key,$jsonobj,$expireAt){ |
||
16 | $data = $jsonobj; |
||
17 | $data->expires_at = $expireAt; |
||
18 | $this->redis->set($key, json_encode($data)); |
||
19 | } |
||
20 | |||
21 | public function get($key){ |
||
22 | return $this->redis->get($key); |
||
23 | } |
||
24 | |||
25 | public function clear($key){ |
||
27 | } |
||
28 | } |