cloudflare-php
cloudflare-php copied to clipboard
Add Get/Update Brotli setting
https://api.cloudflare.com/#zone-settings-get-brotli-setting
Add following in:
cloudflare-php/src/Endpoints/ZoneSettings.php
public function GetBrotliSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/brotli'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result->value;
}
return false;
}
public function updateBrotliSetting($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/brotli',
[
'value' => $value,
]
);
$body = json_decode($return->getBody());
if ($body->success) {
return true;
}
return false;
}
Thanks