class ProviderManager

Manages discovery and instantiation of Bootstrap CDN providers.

Hierarchy

  • class \Drupal\bootstrap\Plugin\PluginManager extends \Drupal\Core\Plugin\DefaultPluginManager

Expanded class hierarchy of ProviderManager

Related topics

4 files declare their use of ProviderManager
CdnProvider.php in src/Plugin/Setting/Advanced/Cdn/CdnProvider.php
Contains \Drupal\bootstrap\Plugin\Setting\Advanced\Cdn\CdnProvider.
deprecated.php in ./deprecated.php
This contains deprecated functions that will be removed in a future release.
ProviderBase.php in src/Plugin/Provider/ProviderBase.php
Contains \Drupal\bootstrap\Plugin\Provider\ProviderBase.
Theme.php in src/Theme.php
Contains \Drupal\bootstrap.

Namespace

Drupal\bootstrap\Plugin
Source
class ProviderManager extends PluginManager {
  /**
   * The base file system path for CDN providers.
   *
   * @var string
   */
  const FILE_PATH = 'public://bootstrap/provider';

  /**
   * Constructs a new \Drupal\bootstrap\Plugin\ProviderManager object.
   *
   * @param \Drupal\bootstrap\Theme $theme
   *   The theme to use for discovery.
   */
  public function __construct(Theme $theme) {
    parent::__construct($theme, 'Plugin/Provider', 'Drupal\bootstrap\Plugin\Provider\ProviderInterface', 'Drupal\bootstrap\Annotation\BootstrapProvider');
    $this->setCacheBackend(\Drupal::cache('discovery'), 'theme:' . $theme->getName() . ':provider', $this->getCacheTags());
  }

  /**
   * {@inheritdoc}
   */
  public function processDefinition(&$definition, $plugin_id) {
    parent::processDefinition($definition, $plugin_id);
    /** @var ProviderInterface $provider */
    $provider = new $definition['class'](['theme' => $this->theme], $plugin_id, $definition);
    $provider->processDefinition($definition, $plugin_id);
  }

}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
PluginManager::$theme protected property The current theme.
PluginManager::$themeHandler protected property The theme handler to check if theme exists.
PluginManager::$themeManager protected property The theme manager to invoke alter hooks.
PluginManager::alterDefinitions protected function
PluginManager::createInstance public function
PluginManager::getCacheTags public function Retrieves the cache tags used to invalidate caches.
PluginManager::getDefinitions public function
PluginManager::getDefinitionsLike public function Retrieves all definitions where the plugin ID matches a certain criteria.
PluginManager::providerExists protected function
ProviderManager::FILE_PATH constant The base file system path for CDN providers.
ProviderManager::processDefinition public function
ProviderManager::__construct public function Constructs a new \Drupal\bootstrap\Plugin\ProviderManager object. Overrides PluginManager::__construct