cloudflare / cloudflare/cloudflare-php

Add Get/Update Brotli setting

Open
#157 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.