| 1 | <?php |
||
| 11 | class cache { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Whether or not caching is active |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | public $active; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The cache data |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | protected $data; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Initialize this class |
||
| 27 | */ |
||
| 28 | public function __construct() { |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Reset the entire cache |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | public function reset() { |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Store a value in the cache |
||
| 44 | * |
||
| 45 | * @param string $func The function trying to store data (should be __FUNCTION__) |
||
| 46 | * @param string $id The storage ID |
||
| 47 | * @param mixed $value The value to store |
||
| 48 | */ |
||
| 49 | public function set(string $func, string $id, $value) { |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Get a value from the cache |
||
| 57 | * |
||
| 58 | * @param string $func The function trying to get data (should be __FUNCTION__) |
||
| 59 | * @param string $id The storage ID |
||
| 60 | * @return mixed The value stored or NULL |
||
| 61 | */ |
||
| 62 | public function get(string $func, string $id) { |
||
| 67 | } |
||
| 68 |