cloudflare / cloudflare/cloudflare-php
Add Get/Update Brotli setting
- Dominant language
- PHP
- Stars
- 674
- Forks
- 268
- PR merge metrics
- No merged PRs in 30d
Description
https://api.cloudflare.com/#zone-settings-get-brotli-setting
Add following in:
cloudflare-php/src/Endpoints/ZoneSettings.php
```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
Contributor guide
Assessment
This issue has not been assessed yet.