Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/media/src/MediaSourceManager.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\media; | |
4 | |
5 use Drupal\Core\Cache\CacheBackendInterface; | |
6 use Drupal\Core\Extension\ModuleHandlerInterface; | |
7 use Drupal\Core\Plugin\DefaultPluginManager; | |
8 use Drupal\media\Annotation\MediaSource; | |
9 | |
10 /** | |
11 * Manages media source plugins. | |
12 */ | |
13 class MediaSourceManager extends DefaultPluginManager { | |
14 | |
15 /** | |
16 * Constructs a new MediaSourceManager. | |
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. | |
25 */ | |
26 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { | |
27 parent::__construct('Plugin/media/Source', $namespaces, $module_handler, MediaSourceInterface::class, MediaSource::class); | |
28 | |
29 $this->alterInfo('media_source_info'); | |
30 $this->setCacheBackend($cache_backend, 'media_source_plugins'); | |
31 } | |
32 | |
33 } |