1 | <?php |
||
17 | class Cache |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected static $filename = '.phplint-cache'; |
||
23 | |||
24 | /** |
||
25 | * Fetch cache. |
||
26 | * |
||
27 | * @return mixed |
||
28 | */ |
||
29 | public static function get() |
||
35 | |||
36 | /** |
||
37 | * Check cache exists. |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public static function exists() |
||
45 | |||
46 | /** |
||
47 | * Alias if exists();. |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public static function isCached() |
||
55 | |||
56 | /** |
||
57 | * Set cache. |
||
58 | * |
||
59 | * @param mixed $contents |
||
60 | * |
||
61 | * @return int |
||
62 | */ |
||
63 | public static function put($contents) |
||
67 | |||
68 | /** |
||
69 | * Set cache filename. |
||
70 | * |
||
71 | * @param string $filename |
||
72 | */ |
||
73 | public static function setFilename($filename) |
||
78 | |||
79 | /** |
||
80 | * Try to create the folder recursively where the cache file is stored. |
||
81 | * It depends on current value of static::getFilename(). |
||
82 | */ |
||
83 | private static function makeFolderForFilename() |
||
91 | |||
92 | /** |
||
93 | * Return cache filename. |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | public static function getFilename() |
||
105 | } |
||
106 |