1 | <?php |
||
11 | class RedisDriver extends BaseDriver |
||
12 | { |
||
13 | private $redis; |
||
14 | private $pre; |
||
15 | |||
16 | public function __construct() |
||
37 | |||
38 | /** |
||
39 | * 根据缓存名获取缓存内容. |
||
40 | * |
||
41 | * @param string $name |
||
42 | * |
||
43 | * @return bool|mixed|string |
||
44 | */ |
||
45 | public function _get($name) |
||
55 | |||
56 | /** |
||
57 | * 根据缓存名 设置缓存值和超时时间. |
||
58 | * |
||
59 | * @param string $name 缓存名 |
||
60 | * @param void $value 缓存值 |
||
61 | * @param int $expires 超时时间 |
||
62 | * |
||
63 | * @return boolean; |
||
64 | */ |
||
65 | public function _set($name, $value, $expires) |
||
75 | |||
76 | /** |
||
77 | * 数据打包. |
||
78 | * |
||
79 | * @param void $data 缓存值 |
||
80 | * @param int $expires 超时时间 |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | private function packData($data) |
||
88 | |||
89 | /** |
||
90 | * 数据解包. |
||
91 | * |
||
92 | * @param $data |
||
93 | * |
||
94 | * @return mixed |
||
95 | */ |
||
96 | private function unpackData($data) |
||
100 | |||
101 | /** |
||
102 | * 创建缓存文件名. |
||
103 | * |
||
104 | * @param string $name 缓存名 |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | private function createFileName($name) |
||
112 | } |
||
113 |
An exit expression should only be used in rare cases. For example, if you write a short command line script.
In most cases however, using an
exit
expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.