class AcquiaPlatformCdnCheck in Acquia Purge 8
Acquia Purge CDN.
Plugin annotation
@PurgeDiagnosticCheck(
id = "acquia_purge_platformcdn_check",
title = @Translation("Acquia Platform CDN"),
description = @Translation("Validates the Acquia Platform CDN configuration."),
dependent_queue_plugins = {},
dependent_purger_plugins = {"acquia_platform_cdn"}
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\purge\Plugin\Purge\DiagnosticCheck\DiagnosticCheckBase implements DiagnosticCheckInterface
- class \Drupal\acquia_purge\Plugin\Purge\DiagnosticCheck\AcquiaPlatformCdnCheck implements DiagnosticCheckInterface
- class \Drupal\purge\Plugin\Purge\DiagnosticCheck\DiagnosticCheckBase implements DiagnosticCheckInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of AcquiaPlatformCdnCheck
File
- src/
Plugin/ Purge/ DiagnosticCheck/ AcquiaPlatformCdnCheck.php, line 22
Namespace
Drupal\acquia_purge\Plugin\Purge\DiagnosticCheckView source
class AcquiaPlatformCdnCheck extends DiagnosticCheckBase implements DiagnosticCheckInterface {
/**
* Information object interfacing with the Acquia platform.
*
* @var \Drupal\acquia_purge\AcquiaCloud\PlatformInfoInterface
*/
protected $platformInfo;
/**
* Constructs a AcquiaPlatformCdnCheck object.
*
* @param \Drupal\acquia_purge\AcquiaCloud\PlatformInfoInterface $acquia_purge_platforminfo
* Information object interfacing with the Acquia platform.
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
*/
public final function __construct(PlatformInfoInterface $acquia_purge_platforminfo, array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->platformInfo = $acquia_purge_platforminfo;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($container
->get('acquia_purge.platforminfo'), $configuration, $plugin_id, $plugin_definition);
}
/**
* {@inheritdoc}
*/
public function run() {
// Verify if we're able to fetch the Platform CDN configuration array.
if (!($backend_config = BackendFactory::getConfig($this->platformInfo))) {
$this->recommendation = $this
->t("Platform CDN isn't yet configured, please contact Acquia Support to do this for you.");
return self::SEVERITY_ERROR;
}
// Lookup a backend class for the Platform CDN vendor.
if (!($backend_class = BackendFactory::getClassFromConfig($backend_config))) {
$this->recommendation = $this
->t("Please upgrade Acquia Purge to a newer version.");
return self::SEVERITY_ERROR;
}
// Ask the backend plugin to validate the Platform CDN configuration array.
if (!$backend_class::validateConfiguration($backend_config)) {
$this->recommendation = $this
->t("Configuration malformed, please contact Acquia Support.");
return self::SEVERITY_ERROR;
}
// Check for temporary runtime errors and suspend operations if present.
if ($error = $backend_class::getTemporaryRuntimeError()) {
$this->recommendation = $error;
return self::SEVERITY_ERROR;
}
$this->recommendation = $this
->t("Acquia Platform CDN is enabled.");
return self::SEVERITY_OK;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AcquiaPlatformCdnCheck:: |
protected | property | Information object interfacing with the Acquia platform. | |
AcquiaPlatformCdnCheck:: |
public static | function |
Creates an instance of the plugin. Overrides DiagnosticCheckBase:: |
|
AcquiaPlatformCdnCheck:: |
public | function |
Perform the check and determine the severity level. Overrides DiagnosticCheckInterface:: |
|
AcquiaPlatformCdnCheck:: |
final public | function |
Constructs a AcquiaPlatformCdnCheck object. Overrides PluginBase:: |
|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
DiagnosticCheckBase:: |
private | property | The description of the check as described in the plugin's metadata. | |
DiagnosticCheckBase:: |
protected | property | A recommendation matching the severity level, may contain NULL. | |
DiagnosticCheckBase:: |
private | property | The severity of the outcome of this check. | |
DiagnosticCheckBase:: |
private | property | The title of the check as described in the plugin's metadata. | |
DiagnosticCheckBase:: |
protected | property | Optional check outcome / value (e.g. version numbers), may contain NULL. | |
DiagnosticCheckBase:: |
public | function |
Gets the description of the check. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Get a recommendation matching the severity level, may return NULL. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Generates a individual Drupal-like requirements array. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Get the severity level, expressed as a status_report severity. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Get the severity level. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Get the severity level as unprefixed string. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Gets the title of the check. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
public | function |
Get an optional value for the check output, may return NULL. Overrides DiagnosticCheckInterface:: |
|
DiagnosticCheckBase:: |
protected | function | Late runtime helper to assure that ::run() got called (and only once). | |
DiagnosticCheckInterface:: |
constant | BLOCKING severity -- Error condition; purge.purgers service cannot operate. | ||
DiagnosticCheckInterface:: |
constant | Non-blocking severity -- Informational message only. | ||
DiagnosticCheckInterface:: |
constant | Non-blocking severity -- check successfully passed. | ||
DiagnosticCheckInterface:: |
constant | Non-blocking severity -- Warning condition; proceed but flag warning. | ||
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |