4 * Contains \Drupal\bootstrap\Plugin\ProviderManager.
7 namespace Drupal\bootstrap\Plugin;
9 use Drupal\bootstrap\Plugin\Provider\ProviderInterface;
10 use Drupal\bootstrap\Theme;
13 * Manages discovery and instantiation of Bootstrap CDN providers.
15 * @ingroup plugins_provider
17 class ProviderManager extends PluginManager {
19 * The base file system path for CDN providers.
23 const FILE_PATH = 'public://bootstrap/provider';
26 * Constructs a new \Drupal\bootstrap\Plugin\ProviderManager object.
28 * @param \Drupal\bootstrap\Theme $theme
29 * The theme to use for discovery.
31 public function __construct(Theme $theme) {
32 parent::__construct($theme, 'Plugin/Provider', 'Drupal\bootstrap\Plugin\Provider\ProviderInterface', 'Drupal\bootstrap\Annotation\BootstrapProvider');
33 $this->setCacheBackend(\Drupal::cache('discovery'), 'theme:' . $theme->getName() . ':provider', $this->getCacheTags());
39 public function processDefinition(&$definition, $plugin_id) {
40 parent::processDefinition($definition, $plugin_id);
41 /** @var ProviderInterface $provider */
42 $provider = new $definition['class'](['theme' => $this->theme], $plugin_id, $definition);
43 $provider->processDefinition($definition, $plugin_id);