1 | <?php |
||
8 | class cache { |
||
9 | |||
10 | /** |
||
11 | * Whether or not caching is active |
||
12 | * @var bool |
||
13 | */ |
||
14 | public $active; |
||
15 | |||
16 | /** |
||
17 | * The cache data |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $data; |
||
21 | |||
22 | /** |
||
23 | * Initialize this class |
||
24 | */ |
||
25 | public function __construct() { |
||
29 | |||
30 | /** |
||
31 | * Reset the entire cache |
||
32 | * |
||
33 | * @return void |
||
34 | */ |
||
35 | public function reset() { |
||
38 | |||
39 | /** |
||
40 | * Store a value in the cache |
||
41 | * |
||
42 | * @param string $func The function trying to store data (should be __FUNCTION__) |
||
43 | * @param string $id The storage ID |
||
44 | * @param mixed $value The value to store |
||
45 | */ |
||
46 | public function set(string $func, string $id, $value) { |
||
51 | |||
52 | /** |
||
53 | * Get a value from the cache |
||
54 | * |
||
55 | * @param string $func The function trying to get data (should be __FUNCTION__) |
||
56 | * @param string $id The storage ID |
||
57 | * @return mixed The value stored or NULL |
||
58 | */ |
||
59 | public function get(string $func, string $id) { |
||
64 | } |
||
65 | |||
66 |