class Ccu3Client in Akamai 7.3
Hierarchy
- class \Drupal\akamai\BaseCcuClient implements CcuClientInterface
- class \Drupal\akamai\Ccu3Client implements CcuClientInterface
Expanded class hierarchy of Ccu3Client
2 files declare their use of Ccu3Client
- BatcherTest.php in tests/
BatcherTest.php - Unit tests for the Drupal\akamai\Batcher class.
- Ccu3ClientTest.php in tests/
Ccu3ClientTest.php - Unit tests for the Drupal\akamai\Ccu3Client class.
File
- src/
Ccu3Client.php, line 12 - Contains the Drupal\akamai\Ccu3Client class.
Namespace
Drupal\akamaiView source
class Ccu3Client extends BaseCcuClient implements CcuClientInterface {
/**
* The version of the CCU API.
*
* @var string
*/
protected $version = 'v3';
/**
* The string used when removing objects.
*/
const OPERATION_DELETE = 'delete';
/**
* Implements CcuClientInterface::getPurgeApiEndpoint().
*/
public function getPurgeApiEndpoint() {
return "/ccu/{$this->version}/{$this->operation}/url/{$this->network}";
}
/**
* Implements CcuClientInterface::getPurgeBody().
*/
public function getPurgeBody($hostname, array $paths) {
// Strip whitespace from paths and ensure each path begins with a '/'.
foreach ($paths as $key => $path) {
$paths[$key] = rtrim(preg_match("/^\\//", $path) ? $path : "/{$path}");
}
$purge_body = array(
'hostname' => $hostname,
'objects' => array_unique($paths),
);
// Ensure a non-associative array for json_encode() so it will output an
// array instead of an object.
$purge_body['objects'] = array_values($purge_body['objects']);
// Use JSON_UNESCAPED_SLASHES to reduce amount of data in request body.
return json_encode($purge_body, JSON_UNESCAPED_SLASHES);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BaseCcuClient:: |
protected | property | An instance of an OPEN EdgeGrid Client. | |
BaseCcuClient:: |
protected | property | The network to use when issuing purge requests. | |
BaseCcuClient:: |
protected | property | The operation to use when issuing purge requests. | |
BaseCcuClient:: |
public | function |
Implements CcuClientInterface::bodyIsBelowLimit(). Overrides CcuClientInterface:: |
|
BaseCcuClient:: |
public | function |
Implements CcuClientInterface::checkProgress(). Overrides CcuClientInterface:: |
|
BaseCcuClient:: |
constant | The string used when invalidating objects. | ||
BaseCcuClient:: |
public | function |
Implements CcuClientInterface::postPurgeRequest(). Overrides CcuClientInterface:: |
|
BaseCcuClient:: |
public | function |
Implements CcuClientInterface::setNetwork(). Overrides CcuClientInterface:: |
|
BaseCcuClient:: |
public | function |
Implements CcuClientInterface::setOperation(). Overrides CcuClientInterface:: |
|
BaseCcuClient:: |
public | function |
Implements CcuClientInterface::__construct(). Overrides CcuClientInterface:: |
|
Ccu3Client:: |
protected | property | The version of the CCU API. | |
Ccu3Client:: |
public | function |
Implements CcuClientInterface::getPurgeApiEndpoint(). Overrides CcuClientInterface:: |
|
Ccu3Client:: |
public | function |
Implements CcuClientInterface::getPurgeBody(). Overrides CcuClientInterface:: |
|
Ccu3Client:: |
constant |
The string used when removing objects. Overrides BaseCcuClient:: |
||
CcuClientInterface:: |
constant | The maximum size, in bytes, of a request body allowed by the API. | ||
CcuClientInterface:: |
constant | String constant for the production network. | ||
CcuClientInterface:: |
constant | String constant for the staging network. |