1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the FOSHttpCache package. |
5
|
|
|
* |
6
|
|
|
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace FOS\HttpCache\ProxyClient; |
13
|
|
|
|
14
|
|
|
use FOS\HttpCache\ProxyClient\Invalidation\BanInterface; |
15
|
|
|
use FOS\HttpCache\ProxyClient\Invalidation\PurgeInterface; |
16
|
|
|
use FOS\HttpCache\ProxyClient\Invalidation\RefreshInterface; |
17
|
|
|
use FOS\HttpCache\ProxyClient\Invalidation\TagsInterface; |
18
|
|
|
use Http\Message\MessageFactory; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Class Noop |
22
|
|
|
* |
23
|
|
|
* @author Gavin Staniforth <[email protected]> |
24
|
|
|
*/ |
25
|
|
|
class Noop implements ProxyClientInterface, BanInterface, PurgeInterface, RefreshInterface, TagsInterface |
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* NoopClient constructor. |
29
|
|
|
* |
30
|
|
|
* @param array $servers |
31
|
|
|
* @param array $options |
32
|
|
|
* @param null $httpClient |
33
|
|
|
* @param null $messageFactory |
34
|
|
|
* @param null $uriFactory |
35
|
|
|
*/ |
36
|
|
|
public function __construct( |
37
|
|
|
array $servers, |
|
|
|
|
38
|
|
|
array $options = [], |
|
|
|
|
39
|
|
|
$httpClient = null, |
|
|
|
|
40
|
|
|
$messageFactory = null, |
|
|
|
|
41
|
|
|
$uriFactory = null |
|
|
|
|
42
|
|
|
) |
43
|
|
|
{ |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* {@inheritdoc} |
48
|
|
|
*/ |
49
|
|
|
public function ban(array $headers) |
50
|
|
|
{ |
51
|
|
|
return $this; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* {@inheritdoc} |
56
|
|
|
*/ |
57
|
|
|
public function banPath($path, $contentType = null, $hosts = null) |
58
|
|
|
{ |
59
|
|
|
return $this; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* {@inheritdoc} |
65
|
|
|
*/ |
66
|
|
|
public function invalidateTags(array $tags) |
67
|
|
|
{ |
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* {@inheritdoc} |
73
|
|
|
*/ |
74
|
|
|
public function getTagsHeaderValue(array $tags) |
75
|
|
|
{ |
76
|
|
|
return []; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* {@inheritdoc} |
81
|
|
|
*/ |
82
|
|
|
public function getTagsHeaderName() |
83
|
|
|
{ |
84
|
|
|
return 'X-Noop-Cache-Tags'; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* {@inheritdoc} |
89
|
|
|
*/ |
90
|
|
|
public function purge($url, array $headers = []) |
91
|
|
|
{ |
92
|
|
|
return $this; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* {@inheritdoc} |
97
|
|
|
*/ |
98
|
|
|
public function refresh($url, array $headers = []) |
99
|
|
|
{ |
100
|
|
|
return $this; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* {@inheritdoc} |
105
|
|
|
*/ |
106
|
|
|
public function flush() |
107
|
|
|
{ |
108
|
|
|
return 0; |
109
|
|
|
} |
110
|
|
|
} |
111
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.