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 array |
||
66 | */ |
||
67 | |||
68 | protected static $namespacePath; |
||
69 | protected static $instances = []; |
||
70 | |||
71 | /** |
||
72 | * @param string $driver |
||
73 | * @param array $config |
||
74 | * @return ExtendedCacheItemPoolInterface |
||
75 | */ |
||
76 | public static function getInstance($driver = 'auto', $config = []) |
||
95 | |||
96 | /** |
||
97 | * @param $config |
||
98 | * @return string |
||
99 | * @throws \Exception |
||
100 | */ |
||
101 | public static function getAutoClass($config) |
||
118 | |||
119 | /** |
||
120 | * @param string $name |
||
121 | * @param array $arguments |
||
122 | * @return \Psr\Cache\CacheItemPoolInterface |
||
123 | */ |
||
124 | public static function __callStatic($name, $arguments) |
||
130 | |||
131 | /** |
||
132 | * @return bool |
||
133 | */ |
||
134 | public static function clearInstances() |
||
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | public static function getNamespacePath() |
||
150 | |||
151 | /** |
||
152 | * @param string $path |
||
153 | */ |
||
154 | public static function setNamespacePath($path) |
||
158 | |||
159 | /** |
||
160 | * @param $name |
||
161 | * @param string $value |
||
162 | */ |
||
163 | public static function setup($name, $value = '') |
||
171 | |||
172 | /** |
||
173 | * @return array |
||
174 | */ |
||
175 | public static function getStaticSystemDrivers() |
||
195 | |||
196 | /** |
||
197 | * @return array |
||
198 | */ |
||
199 | public static function getStaticAllDrivers() |
||
207 | } |
||
208 |
This check looks for the
else
branches ofif
statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
else
branches can be removed.could be turned into
This is much more concise to read.