1 | <?php |
||
18 | class Redis implements Adapter { |
||
19 | |||
20 | protected $redis = null; |
||
21 | protected $options = [ |
||
22 | 'scheme' => 'tcp', |
||
23 | 'host' => '127.0.0.1', |
||
24 | 'port' => 6379, |
||
25 | 'timeout' => 1, |
||
26 | 'reconnect' => 100, |
||
27 | 'prefix' => '', |
||
28 | 'serialize' => true, |
||
29 | 'database' => 0, |
||
30 | 'exceptions' => true, |
||
31 | ]; |
||
32 | |||
33 | public static function valid(){ |
||
36 | |||
37 | public function instance(){ |
||
40 | |||
41 | public function __construct($opt=[]){ |
||
55 | |||
56 | public function get($key){ |
||
59 | |||
60 | public function set($key,$value,$expire=0){ |
||
61 | $expire = (int)$expire; |
||
62 | return $expire > 0 ? $this->redis->setex($key,$expire,serialize($value)) : $this->redis->set($key,serialize($value)); |
||
63 | } |
||
64 | |||
65 | public function delete($key){ |
||
68 | |||
69 | public function exists($key){ |
||
72 | |||
73 | public function flush(){ |
||
74 | return $this->redis->flushdb(); |
||
75 | } |
||
76 | |||
77 | public function inc($key,$value=1){ |
||
80 | |||
81 | public function dec($key,$value=1){ |
||
84 | } |
||
85 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.