1 | <?php |
||
8 | class Cache |
||
9 | { |
||
10 | use ServiceInstances; |
||
11 | |||
12 | const CACHE_BASE_NAME = 'firewall.'; |
||
13 | |||
14 | private $cache; |
||
15 | |||
16 | public function __construct(CacheManager $cache) |
||
20 | |||
21 | /** |
||
22 | * Cache remember. |
||
23 | * |
||
24 | * @param $model |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | public function remember($model) |
||
34 | |||
35 | /** |
||
36 | * Make a cache key. |
||
37 | * |
||
38 | * @param $key |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | public function key($key) |
||
46 | |||
47 | /** |
||
48 | * Flush cache. |
||
49 | */ |
||
50 | public function flush() |
||
54 | |||
55 | /** |
||
56 | * Check if cache has key. |
||
57 | * |
||
58 | * @param $key |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function has($key) |
||
70 | |||
71 | /** |
||
72 | * Get a value from the cache. |
||
73 | * |
||
74 | * @param $key |
||
75 | * @param null $default |
||
76 | * |
||
77 | * @return mixed|null |
||
78 | */ |
||
79 | public function get($key, $default = null) |
||
85 | |||
86 | /** |
||
87 | * Remove an ip address from cache. |
||
88 | * |
||
89 | * @param $key |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | public function forget($key) |
||
99 | |||
100 | /** |
||
101 | * Store an item in the cache for a given number of minutes. |
||
102 | * |
||
103 | * @param string $key |
||
104 | * @param mixed $value |
||
105 | * @param int|null|bool $minutes |
||
106 | * |
||
107 | * @return void |
||
108 | */ |
||
109 | public function put($key, $value, $minutes = null) |
||
115 | |||
116 | /** |
||
117 | * Get cache expire time. |
||
118 | * |
||
119 | * @return int|bool |
||
120 | */ |
||
121 | public function expireTime() |
||
125 | |||
126 | /** |
||
127 | * Get enabled state. |
||
128 | * |
||
129 | * @return int|bool |
||
130 | */ |
||
131 | public function enabled() |
||
136 | } |
||
137 |
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.