1 | <?php |
||
33 | class CacheManager { |
||
34 | |||
35 | /** |
||
36 | * @var boolean |
||
37 | */ |
||
38 | protected static $useCache; |
||
39 | |||
40 | /** |
||
41 | * @var boolean |
||
42 | */ |
||
43 | protected static $enableCache = TRUE; |
||
44 | |||
45 | /** |
||
46 | * @var CacheManager |
||
47 | */ |
||
48 | protected static $instance; |
||
49 | |||
50 | /** |
||
51 | * @var array |
||
52 | */ |
||
53 | protected static $confArray = array(); |
||
54 | |||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $cache = array(); |
||
59 | |||
60 | /** |
||
61 | * Class constructor |
||
62 | * |
||
63 | * @return void |
||
|
|||
64 | */ |
||
65 | 1 | protected function __construct() { |
|
78 | |||
79 | /** |
||
80 | * Method to determine if preCaching should be used or not. |
||
81 | * |
||
82 | * @return boolean |
||
83 | */ |
||
84 | 4 | public static function isCacheEnabled() { |
|
87 | |||
88 | /** |
||
89 | * Use this method to force the cache usage. |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | 2 | public static function enableCache() { |
|
96 | |||
97 | /** |
||
98 | * Use this method to unforce the cache usage. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | 2 | public static function disableCache() { |
|
105 | |||
106 | /** |
||
107 | * Flushed all caches. |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | 4 | public function flushAllCaches() { |
|
114 | |||
115 | /** |
||
116 | * Returns the cache array for a given name space. |
||
117 | * |
||
118 | * @param $namespace |
||
119 | * @return array |
||
120 | */ |
||
121 | 3 | public function get($namespace) { |
|
128 | |||
129 | /** |
||
130 | * Method to write content into the cache. |
||
131 | * |
||
132 | * @param $namespace |
||
133 | * @param $content |
||
134 | * @return void |
||
135 | */ |
||
136 | 3 | public function set($namespace, $content) { |
|
139 | |||
140 | /** |
||
141 | * Returns an instance of the cacheManager singleton. |
||
142 | * |
||
143 | * @return CacheManager |
||
144 | */ |
||
145 | 4 | public static function getInstance() { |
|
152 | |||
153 | /** |
||
154 | * Prevent from cloning |
||
155 | * |
||
156 | * @param void |
||
157 | * @return void |
||
158 | */ |
||
159 | public final function __clone() { |
||
162 | } |
||
163 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.