1 | <?php |
||
18 | class CacheManager |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | public static $cFileName = 'jc-simple-cache-list'; |
||
24 | |||
25 | /** |
||
26 | * @param $cFileName |
||
27 | */ |
||
28 | public static function setCFileName($cFileName) |
||
32 | |||
33 | /** |
||
34 | * @return string |
||
35 | */ |
||
36 | public static function getCFileName() |
||
40 | |||
41 | /** |
||
42 | * @return string |
||
43 | * |
||
44 | * Return absolute file path which store cache list |
||
45 | */ |
||
46 | public static function getCFilePath() |
||
50 | |||
51 | /** |
||
52 | * @param $key |
||
53 | * @return bool|string |
||
54 | * |
||
55 | * Return absolute file path of caching object |
||
56 | */ |
||
57 | public static function get($key) |
||
71 | |||
72 | /** |
||
73 | * @param $key |
||
74 | * @param $filePath |
||
75 | * @return bool |
||
76 | * |
||
77 | * Save $key and $filePath in cacheList |
||
78 | */ |
||
79 | public static function set($key, $filePath, $ttl) |
||
90 | |||
91 | /** |
||
92 | * @param $key |
||
93 | * @return bool |
||
94 | * |
||
95 | * Remove caching object file and remove from cache list |
||
96 | */ |
||
97 | public static function remove($key) |
||
104 | |||
105 | /** |
||
106 | * @param $key |
||
107 | * @return bool |
||
108 | */ |
||
109 | public static function has($key) |
||
114 | |||
115 | /** |
||
116 | * @return array |
||
117 | * |
||
118 | * Return cache list in array |
||
119 | */ |
||
120 | protected static function getCacheList() |
||
128 | |||
129 | /** |
||
130 | * @param $cacheList |
||
131 | * @return bool |
||
132 | */ |
||
133 | protected static function setCacheList($cacheList) |
||
137 | |||
138 | /** |
||
139 | * @param $array |
||
140 | * @return string |
||
141 | */ |
||
142 | protected static function encode($array) |
||
146 | |||
147 | /** |
||
148 | * @param $string |
||
149 | * @return array |
||
150 | */ |
||
151 | protected static function decode($string) |
||
155 | } |