1 | <?php |
||
22 | class Redis extends Storage |
||
23 | { |
||
24 | /** |
||
25 | * The Redis database instance. |
||
26 | * |
||
27 | * @var \Pimf\Redis |
||
28 | */ |
||
29 | protected $redis; |
||
30 | |||
31 | /** |
||
32 | * @param \Pimf\Redis $redis |
||
33 | */ |
||
34 | public function __construct(\Pimf\Redis $redis) |
||
38 | |||
39 | /** |
||
40 | * Determine if an item exists in the cache. |
||
41 | * |
||
42 | * @param string $key |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function has($key) |
||
50 | |||
51 | /** |
||
52 | * Retrieve an item from the cache storage. |
||
53 | * |
||
54 | * @param string $key |
||
55 | * |
||
56 | * @return mixed |
||
57 | */ |
||
58 | protected function retrieve($key) |
||
66 | |||
67 | /** |
||
68 | * Write an item to the cache for a given number of minutes. |
||
69 | * |
||
70 | * @param string $key |
||
71 | * @param mixed $value |
||
72 | * @param int $minutes |
||
73 | */ |
||
74 | public function put($key, $value, $minutes) |
||
79 | |||
80 | /** |
||
81 | * Write an item to the cache that lasts forever. |
||
82 | * |
||
83 | * @param string $key |
||
84 | * @param $value |
||
85 | */ |
||
86 | public function forever($key, $value) |
||
90 | |||
91 | /** |
||
92 | * Delete an item from the cache. |
||
93 | * |
||
94 | * @param string $key |
||
95 | */ |
||
96 | public function forget($key) |
||
100 | } |
||
101 |