1 | <?php |
||
39 | class CacheManager |
||
40 | { |
||
41 | /** |
||
42 | * @var int |
||
43 | */ |
||
44 | public static $ReadHits = 0; |
||
45 | |||
46 | /** |
||
47 | * @var int |
||
48 | */ |
||
49 | public static $WriteHits = 0; |
||
50 | |||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | protected static $config = [ |
||
55 | 'securityKey' => 'auto',// The securityKey that will be used to create sub-directory |
||
56 | 'htaccess' => true,// Auto-generate .htaccess if tit is missing |
||
57 | 'default_chmod' => 0777, // 0777 recommended |
||
58 | 'path' => '',// if not set will be the value of sys_get_temp_dir() |
||
59 | 'fallback' => false, //Fall back when old driver is not support |
||
60 | "limited_memory_each_object" => 4096, // maximum size (bytes) of object store in memory |
||
61 | "compress_data" => false, // compress stored data, if the backend supports it |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * @var string |
||
66 | */ |
||
67 | protected static $namespacePath; |
||
68 | |||
69 | /** |
||
70 | * @var array |
||
71 | */ |
||
72 | protected static $instances = []; |
||
73 | |||
74 | /** |
||
75 | * @param string $driver |
||
76 | * @param array $config |
||
77 | * @return ExtendedCacheItemPoolInterface |
||
78 | */ |
||
79 | public static function getInstance($driver = 'auto', $config = []) |
||
115 | |||
116 | /** |
||
117 | * @param $config |
||
118 | * @return string |
||
119 | * @throws phpFastCacheDriverCheckException |
||
120 | */ |
||
121 | public static function getAutoClass($config = []) |
||
138 | |||
139 | /** |
||
140 | * @param string $name |
||
141 | * @param array $arguments |
||
142 | * @return \Psr\Cache\CacheItemPoolInterface |
||
143 | */ |
||
144 | public static function __callStatic($name, $arguments) |
||
150 | |||
151 | /** |
||
152 | * @return bool |
||
153 | */ |
||
154 | public static function clearInstances() |
||
163 | |||
164 | /** |
||
165 | * @return string |
||
166 | */ |
||
167 | public static function getNamespacePath() |
||
171 | |||
172 | /** |
||
173 | * @param string $path |
||
174 | */ |
||
175 | public static function setNamespacePath($path) |
||
179 | |||
180 | /** |
||
181 | * @param $name |
||
182 | * @param string $value |
||
183 | * @deprecated Method "setup" is deprecated and will be removed in 5.1. Use method "setDefaultConfig" instead. |
||
184 | */ |
||
185 | public static function setup($name, $value = '') |
||
190 | |||
191 | /** |
||
192 | * @param $name string|array |
||
193 | * @param mixed $value |
||
194 | */ |
||
195 | public static function setDefaultConfig($name, $value = null) |
||
205 | |||
206 | /** |
||
207 | * @return array |
||
208 | */ |
||
209 | public static function getDefaultConfig() |
||
213 | |||
214 | /** |
||
215 | * @return array |
||
216 | */ |
||
217 | public static function getStaticSystemDrivers() |
||
237 | |||
238 | /** |
||
239 | * @return array |
||
240 | */ |
||
241 | public static function getStaticAllDrivers() |
||
249 | |||
250 | /** |
||
251 | * @param string $driverName |
||
252 | * @return string |
||
253 | */ |
||
254 | public static function standardizeDriverName($driverName) |
||
258 | } |
||
259 |