1 | <?php |
||
20 | class LoggerCache implements TagCache, CacheDecorator |
||
21 | { |
||
22 | use CacheDecoratorTrait, LoggerCacheTrait; |
||
23 | |||
24 | /** |
||
25 | * @var bool |
||
26 | */ |
||
27 | private $withExceptions; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $logLevel; |
||
33 | |||
34 | /** |
||
35 | * SilentCacheDecorator constructor. |
||
36 | * |
||
37 | * @param Cache $cache |
||
38 | * @param bool $withExceptions |
||
39 | * @param LoggerInterface $logger |
||
40 | 1 | * @param string $logLevel |
|
41 | */ |
||
42 | public function __construct( |
||
53 | |||
54 | /** |
||
55 | 1 | * {@inheritdoc} |
|
56 | */ |
||
57 | 1 | public function set($key, $value, $timeToLive = null) |
|
67 | |||
68 | /** |
||
69 | 1 | * {@inheritdoc} |
|
70 | */ |
||
71 | 1 | public function has($key) |
|
81 | |||
82 | /** |
||
83 | 1 | * {@inheritdoc} |
|
84 | */ |
||
85 | 1 | public function get($key, $default = null) |
|
95 | |||
96 | /** |
||
97 | 1 | * {@inheritdoc} |
|
98 | */ |
||
99 | 1 | public function demand($key) |
|
109 | |||
110 | /** |
||
111 | 1 | * {@inheritdoc} |
|
112 | */ |
||
113 | 1 | public function delete($key) |
|
123 | |||
124 | /** |
||
125 | 1 | * {@inheritdoc} |
|
126 | */ |
||
127 | 1 | public function flush() |
|
136 | |||
137 | /** |
||
138 | 1 | * {@inheritdoc} |
|
139 | */ |
||
140 | 1 | public function setItems(array $items, $timeToLive = null) |
|
150 | |||
151 | /** |
||
152 | 1 | * {@inheritdoc} |
|
153 | */ |
||
154 | 1 | public function getItems(array $keys) |
|
164 | |||
165 | /** |
||
166 | 1 | * {@inheritdoc} |
|
167 | */ |
||
168 | 1 | public function deleteItems(array $keys) |
|
178 | |||
179 | /** |
||
180 | * Gets the remaining time to live for an item |
||
181 | * |
||
182 | * @param $key |
||
183 | * |
||
184 | 1 | * @return int|null |
|
185 | */ |
||
186 | 1 | public function getTimeToLive($key) |
|
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | public function tag($tagName) |
||
203 | |||
204 | 1 | /** |
|
205 | * @param callable $callable |
||
206 | * |
||
207 | 1 | * @param string $method |
|
208 | 1 | * @param array $arguments |
|
209 | 1 | * |
|
210 | 1 | * @return mixed |
|
211 | 1 | * @throws BackendOperationFailedException |
|
212 | 1 | * @throws CacheException |
|
213 | */ |
||
214 | protected function call(callable $callable, $method, $arguments = []) |
||
231 | 1 | ||
232 | 1 | /** |
|
233 | 1 | * @param Exception $exception |
|
234 | 1 | * @param string $method |
|
235 | 1 | * @param array $arguments |
|
236 | 1 | * |
|
237 | 1 | * @return bool |
|
238 | 1 | */ |
|
239 | protected function logException(Exception $exception, $method, array $arguments) |
||
249 | } |
||
250 |