1 | <?php |
||
34 | class Fastly extends HttpProxyClient implements ClearCapable, PurgeCapable, RefreshCapable, TagCapable |
||
35 | { |
||
36 | /** |
||
37 | * @internal |
||
38 | */ |
||
39 | const HTTP_METHOD_PURGE = 'PURGE'; |
||
40 | |||
41 | /** |
||
42 | * @internal |
||
43 | * |
||
44 | * @see https://docs.fastly.com/api/purge#purge_db35b293f8a724717fcf25628d713583 Fastly's limit on batch tag purges. |
||
45 | */ |
||
46 | const TAG_BATCH_PURGE_LIMIT = 256; |
||
47 | |||
48 | /** |
||
49 | * @internal |
||
50 | * |
||
51 | * @see https://docs.fastly.com/api/purge Base url endpoint used on anything but url PURGE/GET/HEAD. |
||
52 | */ |
||
53 | const API_ENDPOINT = 'https://api.fastly.com'; |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | * |
||
58 | * @see https://docs.fastly.com/api/purge#purge_db35b293f8a724717fcf25628d713583 |
||
59 | */ |
||
60 | public function invalidateTags(array $tags) |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | * |
||
85 | * @see https://docs.fastly.com/api/purge#soft_purge_0c4f56f3d68e9bed44fb8b638b78ea36 |
||
86 | * @see https://docs.fastly.com/guides/purging/authenticating-api-purge-requests#purging-urls-with-an-api-token |
||
87 | */ |
||
88 | public function purge($url, array $headers = []) |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function refresh($url, array $headers = []) |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | * |
||
131 | * @see https://docs.fastly.com/api/purge#purge_bee5ed1a0cfd541e8b9f970a44718546 |
||
132 | * |
||
133 | * Warning: |
||
134 | * - Does not support soft purge, for that use an "all" key. |
||
135 | * - Requires a API token of a user with at least Engineer permissions. |
||
136 | */ |
||
137 | public function clear() |
||
148 | |||
149 | /** |
||
150 | * {@inheritdoc} Always provides default authentication token on "Fastly-Key" header. |
||
151 | */ |
||
152 | protected function queueRequest($method, $url, array $headers, $validateHost = true, $body = null) |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | protected function configureOptions() |
||
182 | } |
||
183 |