Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate / src / Plugin / MigrationPluginManager.php
index b572bb5cc5f0d5df0835201b82e5d8be667b4211..74f151999bd47fe9d9fb23b545469702bbc016b6 100644 (file)
@@ -60,11 +60,22 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
   }
 
   /**
-   * {@inheritdoc}
+   * Gets the plugin discovery.
+   *
+   * This method overrides DefaultPluginManager::getDiscovery() in order to
+   * search for migration configurations in the MODULENAME/migrations and
+   * MODULENAME/migration_templates directories. Throws a deprecation notice if
+   * the MODULENAME/migration_templates directory exists.
    */
   protected function getDiscovery() {
     if (!isset($this->discovery)) {
       $directories = array_map(function ($directory) {
+        // Check for use of the @deprecated /migration_templates directory.
+        // @todo Remove use of /migration_templates in Drupal 9.0.0.
+        if (is_dir($directory . '/migration_templates')) {
+          @trigger_error('Use of the /migration_templates directory to store migration configuration files is deprecated in Drupal 8.1.0 and will be removed before Drupal 9.0.0. See https://www.drupal.org/node/2920988.', E_USER_DEPRECATED);
+        }
+        // But still accept configurations found in /migration_templates.
         return [$directory . '/migration_templates', $directory . '/migrations'];
       }, $this->moduleHandler->getModuleDirectories());
 
@@ -116,13 +127,7 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
   }
 
   /**
-   * Create migrations given a tag.
-   *
-   * @param string $tag
-   *   A migration tag we want to filter by.
-   *
-   * @return array|\Drupal\migrate\Plugin\MigrationInterface[]
-   *   An array of migration objects with the given tag.
+   * {@inheritdoc}
    */
   public function createInstancesByTag($tag) {
     $migrations = array_filter($this->getDefinitions(), function ($migration) use ($tag) {