You are here

final public function AcquiaPlatformCdnTagsHeader::__construct in Acquia Purge 8

Constructs a AcquiaPlatformCdnTagsHeader object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\acquia_purge\AcquiaCloud\PlatformInfoInterface $acquia_purge_platforminfo: Information object interfacing with the Acquia platform.

Overrides PluginBase::__construct

File

src/Plugin/Purge/TagsHeader/AcquiaPlatformCdnTagsHeader.php, line 48

Class

AcquiaPlatformCdnTagsHeader
Exports a tags header for the current Platform CDN backend.

Namespace

Drupal\acquia_purge\Plugin\Purge\TagsHeader

Code

public final function __construct(array $configuration, $plugin_id, $plugin_definition, PlatformInfoInterface $acquia_purge_platforminfo) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->platformInfo = $acquia_purge_platforminfo;
  $this->backendClass = BackendFactory::getClass($this->platformInfo);

  // When a backend is available, inject the platform info object.
  if ($this->backendClass) {
    $this->backendClass::platformInfo($this->platformInfo);
  }
}