1 | <?php |
||
11 | class FileDriver extends BaseDriver |
||
12 | { |
||
13 | /** |
||
14 | * @param string $name |
||
15 | * |
||
16 | * @return bool|null|string|void |
||
17 | */ |
||
18 | public function _get($name) |
||
36 | |||
37 | /** |
||
38 | * 根据缓存名 设置缓存值和超时时间. |
||
39 | * |
||
40 | * @param string $name 缓存名 |
||
41 | * @param void $value 缓存值 |
||
42 | * @param int $expires 超时时间 |
||
43 | * |
||
44 | * @return boolean; |
||
45 | */ |
||
46 | public function _set($name, $value, $expires) |
||
53 | |||
54 | /** |
||
55 | * 数据打包. |
||
56 | * |
||
57 | * @param void $data 缓存值 |
||
58 | * @param int $expires 超时时间 |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | private function packData($data, $expires) |
||
71 | |||
72 | /** |
||
73 | * @param $data |
||
74 | * |
||
75 | * @return bool |
||
76 | */ |
||
77 | private function unpackData($data) |
||
87 | |||
88 | /** |
||
89 | * 创建缓存文件名. |
||
90 | * |
||
91 | * @param string $name 缓存名 |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | private function createFileName($name) |
||
99 | } |
||
100 |
If you suppress an error, we recommend checking for the error condition explicitly: