1 | <?php |
||
8 | class Cache |
||
9 | { |
||
10 | use ServiceInstances; |
||
11 | |||
12 | const CACHE_BASE_NAME = 'firewall.'; |
||
13 | |||
14 | private $cache; |
||
15 | |||
16 | 75 | public function __construct(CacheManager $cache) |
|
20 | |||
21 | /** |
||
22 | * Cache remember. |
||
23 | * |
||
24 | * @param $model |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | 37 | public function remember($model) |
|
34 | |||
35 | /** |
||
36 | * Make a cache key. |
||
37 | * |
||
38 | * @param $key |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | 30 | public function key($key) |
|
46 | |||
47 | /** |
||
48 | * Flush cache. |
||
49 | * |
||
50 | */ |
||
51 | 75 | public function flush() |
|
55 | |||
56 | /** |
||
57 | * Check if cache has key. |
||
58 | * |
||
59 | * @param $key |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | 57 | public function has($key) |
|
71 | |||
72 | /** |
||
73 | * Get a value from the cache. |
||
74 | * |
||
75 | * @param $key |
||
76 | * |
||
77 | * @return mixed|null |
||
78 | */ |
||
79 | 15 | public function get($key) |
|
85 | |||
86 | /** |
||
87 | * Remove an ip address from cache. |
||
88 | * |
||
89 | * @param $key |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | 8 | 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 | 21 | public function put($key, $value, $minutes = null) |
|
115 | |||
116 | /** |
||
117 | * Get cache expire time. |
||
118 | * |
||
119 | * @return int|bool |
||
120 | */ |
||
121 | 58 | public function expireTime() |
|
125 | |||
126 | /** |
||
127 | * Get enabled state. |
||
128 | * |
||
129 | * @return int|bool |
||
130 | */ |
||
131 | 58 | 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.