class Custom

  1. 8.x-3.x src/Plugin/Provider/Custom.php Custom
  2. 7.x-3.x includes/cdn/Custom.php Custom

The "custom" CDN Provider plugin.

Plugin annotation

@BootstrapProvider(
  id = "custom",
  label = @Translation("Custom"),
  description = @Translation("Allows the use of any CDN by providing the ability to manually specify a repository of available URLs."),
  weight = 100
)

Hierarchy

Expanded class hierarchy of Custom

Related topics

Namespace

Drupal\bootstrap\Plugin\Provider
Source
class Custom extends ProviderBase {

  /**
   * A list of valid Custom CDN URLs.
   *
   * @var string[]
   */
  protected $urls;

  /**
   * {@inheritdoc}
   */
  protected function discoverCdnAssets($version, $theme = NULL) {
    $themes = $this->getCdnThemes($version);
    return isset($themes[$theme]) ? $themes[$theme] : new CdnAssets();
  }

  /**
   * {@inheritdoc}
   */
  protected function discoverCdnThemes($version) {
    return $this->parseAssets($this->getUrls())->getThemes();
  }

  /**
   * {@inheritdoc}
   */
  protected function discoverCdnVersions() {
    $assets = $this->parseAssets($this->getUrls());
    $versions = [];
    foreach ($assets->toArray() as $asset) {
      if ($version = $asset