You are here

public function PlatformInfo::getPlatformCdnConfiguration in Acquia Purge 8

Get the Acquia Platform CDN configuration.

Return value

mixed[] Associated array with configuration parameters for Acquia Platform CDN, which has at minimum the following two keys:

  • config: Configuration source string, either 'settings' or 'state'.
  • vendor: The underlying CDN backend used by the platform.
  • ... other keys can be present depending on the used backend.

Throws

\RuntimeException Thrown when either no configuration is available.

Overrides PlatformInfoInterface::getPlatformCdnConfiguration

File

src/AcquiaCloud/PlatformInfo.php, line 204

Class

PlatformInfo
Provides an information object interfacing with the Acquia platform.

Namespace

Drupal\acquia_purge\AcquiaCloud

Code

public function getPlatformCdnConfiguration() {
  if (empty($this->platformCdn)) {
    throw new \RuntimeException("No Platform CDN configuration available.");
  }
  if (!(isset($this->platformCdn['vendor']) && strlen($this->platformCdn['vendor']))) {
    throw new \RuntimeException("Platform CDN vendor not specified.");
  }
  if (!(isset($this->platformCdn['config']) && strlen($this->platformCdn['config']))) {
    throw new \RuntimeException("Platform CDN config has no 'config' key.");
  }
  return $this->platformCdn;
}