1 | <?php |
||
34 | class VarnishCache implements CacheAdapterInterface |
||
35 | { |
||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $token; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $servers; |
||
45 | |||
46 | /** |
||
47 | * @var RouterInterface |
||
48 | */ |
||
49 | protected $router; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $purgeInstruction; |
||
55 | |||
56 | /** |
||
57 | * @var ControllerResolverInterface |
||
58 | */ |
||
59 | protected $resolver; |
||
60 | |||
61 | /** |
||
62 | * Constructor. |
||
63 | * |
||
64 | * @param string $token A token |
||
65 | * @param array $servers An array of servers |
||
66 | * @param RouterInterface $router A router instance |
||
67 | * @param string $purgeInstruction The purge instruction (purge in Varnish 2, ban in Varnish 3) |
||
68 | * @param null|ControllerResolverInterface $resolver A controller resolver instance |
||
69 | */ |
||
70 | public function __construct($token, array $servers, RouterInterface $router, $purgeInstruction, ControllerResolverInterface $resolver = null) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function flushAll(): bool |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function flush(array $keys = []): bool |
||
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | public function has(array $keys): bool |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function get(array $keys): CacheElementInterface |
||
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function set(array $keys, $data, int $ttl = CacheElement::DAY, array $contextualKeys = []): CacheElementInterface |
||
138 | |||
139 | /** |
||
140 | * Cache action. |
||
141 | * |
||
142 | * @param Request $request |
||
143 | * |
||
144 | * @return mixed |
||
145 | */ |
||
146 | public function cacheAction(Request $request) |
||
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | public function isContextual(): bool |
||
179 | |||
180 | /** |
||
181 | * @param string $command |
||
182 | * @param string $expression |
||
183 | * |
||
184 | * @return bool |
||
185 | */ |
||
186 | protected function runCommand($command, $expression) |
||
206 | |||
207 | /** |
||
208 | * Gets the URL by the given keys. |
||
209 | * |
||
210 | * @param array $keys |
||
211 | * |
||
212 | * @return string |
||
213 | */ |
||
214 | protected function getUrl(array $keys) |
||
223 | |||
224 | /** |
||
225 | * Computes the given keys. |
||
226 | * |
||
227 | * @param array $keys |
||
228 | * |
||
229 | * @return string |
||
230 | */ |
||
231 | protected function computeHash(array $keys) |
||
237 | |||
238 | /** |
||
239 | * Normalizes the given key. |
||
240 | * |
||
241 | * @param string $key |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | protected function normalize($key) |
||
249 | } |
||
250 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.