Merge pull request #62 from powerkent/fix-refresh-cache
fix: Cloudflare Api doesn't like empty tags
This commit is contained in:
@@ -164,11 +164,18 @@ class Zones implements API
|
|||||||
throw new EndpointException('No files, tags or hosts to purge.');
|
throw new EndpointException('No files, tags or hosts to purge.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = [
|
$options = [];
|
||||||
'files' => $files,
|
if (!is_null($files)) {
|
||||||
'tags' => $tags,
|
$options['files'] = $files;
|
||||||
'hosts' => $hosts
|
}
|
||||||
];
|
|
||||||
|
if (!is_null($tags)) {
|
||||||
|
$options['tags'] = $tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_null($hosts)) {
|
||||||
|
$options['hosts'] = $hosts;
|
||||||
|
}
|
||||||
|
|
||||||
$user = $this->adapter->delete('zones/' . $zoneID . '/purge_cache', $options);
|
$user = $this->adapter->delete('zones/' . $zoneID . '/purge_cache', $options);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user