Environment API
The environment endpoint contains only the cache purge for the time being.
#
Cache purgeThe cache purge call will return an instance of the Response-object.
$environmentId = 123;$files = [ 'https://example.com/some/path.html', 'https://example.com/some/other/path.html',];$prefixes = [ 'https://example.com/some/prefix/path', 'https://example.com/some/other/prefix/path',];$client->environment->purgeCache($environmentId, $files, $prefixes);
You can also specify the environment ID in the chained method calls.
$files = [ 'https://example.com/some/path.html', 'https://example.com/some/other/path.html',];$prefixes = [ 'https://example.com/some/prefix/path', 'https://example.com/some/other/prefix/path',];$client->environment($environmentId)->purgeCache($files, $prefixes);
#
GetReturns a specific environment by ID.
$response = $client->environment->get(123);if ( $response->wasSuccessful() && $item = $response->getFirstResultItem()) { // Do something echo $item->id; // 123}
#
UpdateUpdated an environment by ID.
$response = $client->environment->update(123, [ 'attributes' => [ 'title' => 'Updated title' ]]);if ($response->wasSuccessful()) { // Cronjob updated}