Further modules included.
[yaffs-website] / web / modules / contrib / libraries / src / ExternalLibrary / Type / LibraryTypeFactory.php
1 <?php
2
3 namespace Drupal\libraries\ExternalLibrary\Type;
4
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Plugin\DefaultPluginManager;
8 use Drupal\libraries\Annotation\LibraryType;
9
10 /**
11  * Provides a plugin manager for library type plugins.
12  */
13 class LibraryTypeFactory extends DefaultPluginManager {
14
15   /**
16    * Constructs a locator manager.
17    *
18    * @param \Traversable $namespaces
19    *   An object that implements \Traversable which contains the root paths
20    *   keyed by the corresponding namespace to look for plugin implementations.
21    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
22    *   Cache backend instance to use.
23    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
24    *   The module handler to invoke the alter hook with.
25    */
26   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
27     parent::__construct('Plugin/libraries/Type', $namespaces, $module_handler, LibraryTypeInterface::class, LibraryType::class);
28     $this->alterInfo('libraries_library_type_info');
29     $this->setCacheBackend($cache_backend, 'libraries_library_type_info');
30   }
31
32 }