abstract class BackendBase in Acquia Purge 8
Provides a backend for the Platform CDN purger.
Hierarchy
- class \Drupal\acquia_purge\AcquiaPlatformCdn\BackendBase implements BackendInterface uses DebuggerAwareTrait
Expanded class hierarchy of BackendBase
File
- src/
AcquiaPlatformCdn/ BackendBase.php, line 14
Namespace
Drupal\acquia_purge\AcquiaPlatformCdnView source
abstract class BackendBase implements BackendInterface {
use DebuggerAwareTrait;
/**
* The Guzzle HTTP client.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $httpClient;
/**
* Acquia Platform CDN configuration settings.
*
* Associative array with arbitrary settings coming from:
* \Drupal\acquia_purge\AcquiaCloud\PlatformInfoInterface::getPlatformCdnConfiguration.
*
* @var array
*/
protected $config;
/**
* Information object interfacing with the Acquia platform.
*
* @var \Drupal\acquia_purge\AcquiaCloud\PlatformInfoInterface
*/
protected $platformInfo;
/**
* {@inheritdoc}
*/
public function __construct(array $config, PlatformInfoInterface $acquia_purge_platforminfo, LoggerChannelPartInterface $logger, DebuggerInterface $debugger, ClientInterface $http_client) {
$this->platformInfo = $acquia_purge_platforminfo;
$this->httpClient = $http_client;
$this->logger = $logger;
$this->config = $config;
$this
->setDebugger($debugger);
}
/**
* {@inheritdoc}
*/
public static function getTemporaryRuntimeError() {
if ($error = \Drupal::cache()
->get('acquia_purge_cdn_runtime_error')) {
return $error->data;
}
return '';
}
/**
* {@inheritdoc}
*/
public static function platformInfo(PlatformInfoInterface $set = NULL) {
static $platforminfo;
if (is_null($platforminfo) && !is_null($set)) {
$platforminfo = $set;
}
elseif (is_null($platforminfo)) {
throw new \RuntimeException("BackendBase::platformInfo can't deliver requested instance.");
}
return $platforminfo;
}
/**
* {@inheritdoc}
*/
public static function setTemporaryRuntimeError($message, $timeout = 300) {
\Drupal::cache()
->set('acquia_purge_cdn_runtime_error', $message, time() + $timeout);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BackendBase:: |
protected | property | Acquia Platform CDN configuration settings. | |
BackendBase:: |
protected | property | The Guzzle HTTP client. | |
BackendBase:: |
protected | property | Information object interfacing with the Acquia platform. | |
BackendBase:: |
public static | function |
Check if a temporary runtime error has been set. Overrides BackendInterface:: |
|
BackendBase:: |
public static | function |
Get the information object interfacing with the Acquia platform. Overrides BackendInterface:: |
|
BackendBase:: |
public static | function |
Set a temporary runtime error. Overrides BackendInterface:: |
|
BackendBase:: |
public | function |
Construct a vendor backend for the Platform CDN purger. Overrides BackendInterface:: |
1 |
BackendInterface:: |
public | function | Invalidate all 'everything' invalidations. | 1 |
BackendInterface:: |
public | function | Invalidate all 'tag' invalidations. | 1 |
BackendInterface:: |
public | function | Invalidate all 'url' invalidations. | 1 |
BackendInterface:: |
public static | function | Fetch the HTTP response header name that the CDN vendor needs. | 1 |
BackendInterface:: |
public static | function | Format the given cache tags for the header value representation. | 1 |
BackendInterface:: |
public static | function | Validate the configuration array given. | 1 |
DebuggerAwareTrait:: |
private | property | The debugger instance. | |
DebuggerAwareTrait:: |
public | function | ||
DebuggerAwareTrait:: |
public | function | ||
PurgeLoggerAwareTrait:: |
protected | property | Channel logger. | |
PurgeLoggerAwareTrait:: |
public | function |