1 | <?php |
||
13 | class DynamicCSSCache |
||
|
|||
14 | { |
||
15 | /** |
||
16 | * @var Singleton The reference to *Singleton* instance of this class |
||
17 | */ |
||
18 | private static $instance; |
||
19 | |||
20 | /** |
||
21 | * @var array The reference to the cached compiled CSS that is stored in the database |
||
22 | */ |
||
23 | private static $cache; |
||
24 | |||
25 | /** |
||
26 | * Returns the *Singleton* instance of this class. |
||
27 | * |
||
28 | * @return Singleton The *Singleton* instance. |
||
29 | */ |
||
30 | public static function get_instance() |
||
39 | |||
40 | /** |
||
41 | * Returns the compiled CSS for the given handle if it exists in the cache. |
||
42 | * Returns false otherwise. |
||
43 | * |
||
44 | * @param string $handle The handle of the stylesheet |
||
45 | * @return boolean|string |
||
46 | */ |
||
47 | public function get( $handle ) |
||
55 | |||
56 | /** |
||
57 | * Update the compiled CSS for the given handle. |
||
58 | * |
||
59 | * @param string $handle The handle of the stylesheet |
||
60 | * @param type $compiled_css |
||
61 | */ |
||
62 | public function update( $handle, $compiled_css ) |
||
67 | |||
68 | /** |
||
69 | * Clear the compiled CSS from cache for the given handle. |
||
70 | * |
||
71 | * @param string $handle The handle of the stylesheet |
||
72 | */ |
||
73 | public function clear( $handle ) |
||
78 | |||
79 | /** |
||
80 | * Load the cache value from the database or create an empty array if the |
||
81 | * cache is empty. |
||
82 | */ |
||
83 | private static function load_cache() |
||
92 | |||
93 | /** |
||
94 | * Update the database option with the local cache value. |
||
95 | */ |
||
96 | private function update_option() |
||
100 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.