X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Fsrc%2FPlugin%2FMigrateSourcePluginManager.php;fp=web%2Fcore%2Fmodules%2Fmigrate%2Fsrc%2FPlugin%2FMigrateSourcePluginManager.php;h=2d127502305f96254053ac0808e52abeb5ba611c;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php b/web/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php new file mode 100644 index 000000000..2d1275023 --- /dev/null +++ b/web/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php @@ -0,0 +1,73 @@ +discovery) { + $discovery = new AnnotatedClassDiscoveryAutomatedProviders($this->subdir, $this->namespaces, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces); + $this->discovery = new ContainerDerivativeDiscoveryDecorator($discovery); + } + return $this->discovery; + } + + /** + * Finds plugin definitions. + * + * @return array + * List of definitions to store in cache. + * + * @todo This is a temporary solution to the fact that migration source + * plugins have more than one provider. This functionality will be moved to + * core in https://www.drupal.org/node/2786355. + */ + protected function findDefinitions() { + $definitions = $this->getDiscovery()->getDefinitions(); + foreach ($definitions as $plugin_id => &$definition) { + $this->processDefinition($definition, $plugin_id); + } + $this->alterDefinitions($definitions); + return ProviderFilterDecorator::filterDefinitions($definitions, function ($provider) { + return $this->providerExists($provider); + }); + } + +}