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 | public static $config = [ |
||
55 | 'default_chmod' => 0777, // 0777 recommended |
||
56 | 'fallback' => 'files', //Fall back when old driver is not support |
||
57 | 'securityKey' => 'auto', |
||
58 | 'htaccess' => true, |
||
59 | 'path' => '',// if not set will be the value of sys_get_temp_dir() |
||
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 = []) |
||
101 | |||
102 | /** |
||
103 | * @param $config |
||
104 | * @return string |
||
105 | * @throws phpFastCacheDriverCheckException |
||
106 | */ |
||
107 | public static function getAutoClass($config = []) |
||
124 | |||
125 | /** |
||
126 | * @param string $name |
||
127 | * @param array $arguments |
||
128 | * @return \Psr\Cache\CacheItemPoolInterface |
||
129 | */ |
||
130 | public static function __callStatic($name, $arguments) |
||
136 | |||
137 | /** |
||
138 | * @return bool |
||
139 | */ |
||
140 | public static function clearInstances() |
||
148 | |||
149 | /** |
||
150 | * @return string |
||
151 | */ |
||
152 | public static function getNamespacePath() |
||
156 | |||
157 | /** |
||
158 | * @param string $path |
||
159 | */ |
||
160 | public static function setNamespacePath($path) |
||
164 | |||
165 | /** |
||
166 | * @param $name |
||
167 | * @param string $value |
||
168 | */ |
||
169 | public static function setup($name, $value = '') |
||
177 | |||
178 | /** |
||
179 | * @return array |
||
180 | */ |
||
181 | public static function getStaticSystemDrivers() |
||
201 | |||
202 | /** |
||
203 | * @return array |
||
204 | */ |
||
205 | public static function getStaticAllDrivers() |
||
213 | } |
||
214 |