Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / src / Command / Migrate / ExecuteCommand.php
index 325f85515e861efc3154818e3184afbb22654bf4..1c4fb2587a8a3e573925c6f0f20ca749468b6a6d 100644 (file)
@@ -47,13 +47,6 @@ class ExecuteCommand extends Command
         parent::__construct();
     }
 
-    /**
-     * @DrupalCommand(
-     *     dependencies = {
-     *         "migrate"
-     *     }
-     * )
-     */
     protected function configure()
     {
         $this
@@ -62,62 +55,62 @@ class ExecuteCommand extends Command
             ->addArgument('migration-ids', InputArgument::IS_ARRAY, $this->trans('commands.migrate.execute.arguments.id'))
             ->addOption(
                 'site-url',
-                '',
+                null,
                 InputOption::VALUE_REQUIRED,
                 $this->trans('commands.migrate.execute.options.site-url')
             )
             ->addOption(
                 'db-type',
-                '',
+                null,
                 InputOption::VALUE_REQUIRED,
                 $this->trans('commands.migrate.setup.migrations.options.db-type')
             )
             ->addOption(
                 'db-host',
-                '',
+                null,
                 InputOption::VALUE_REQUIRED,
                 $this->trans('commands.migrate.execute.options.db-host')
             )
             ->addOption(
                 'db-name',
-                '',
+                null,
                 InputOption::VALUE_REQUIRED,
                 $this->trans('commands.migrate.execute.options.db-name')
             )
             ->addOption(
                 'db-user',
-                '',
+                null,
                 InputOption::VALUE_REQUIRED,
                 $this->trans('commands.migrate.execute.options.db-user')
             )
             ->addOption(
                 'db-pass',
-                '',
+                null,
                 InputOption::VALUE_OPTIONAL,
                 $this->trans('commands.migrate.execute.options.db-pass')
             )
             ->addOption(
                 'db-prefix',
-                '',
+                null,
                 InputOption::VALUE_OPTIONAL,
                 $this->trans('commands.migrate.execute.options.db-prefix')
             )
             ->addOption(
                 'db-port',
-                '',
+                null,
                 InputOption::VALUE_REQUIRED,
                 $this->trans('commands.migrate.execute.options.db-port')
             )
             ->addOption(
                 'exclude',
-                '',
+                null,
                 InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
                 $this->trans('commands.migrate.execute.options.exclude'),
                 []
             )
             ->addOption(
                 'source-base_path',
-                '',
+                null,
                 InputOption::VALUE_OPTIONAL,
                 $this->trans('commands.migrate.execute.options.source-base_path')
             );
@@ -204,7 +197,7 @@ class ExecuteCommand extends Command
 
         if (!$drupal_version = $this->getLegacyDrupalVersion($this->migrateConnection)) {
             $io->error($this->trans('commands.migrate.setup.migrations.questions.not-drupal'));
-            return;
+            return 1;
         }
         
         $database = $this->getDBInfo();
@@ -294,7 +287,7 @@ class ExecuteCommand extends Command
 
         // If migrations weren't provided finish execution
         if (empty($migration_ids)) {
-            return;
+            return 1;
         }
 
         if (!$this->migrateConnection) {
@@ -304,7 +297,7 @@ class ExecuteCommand extends Command
         
         if (!$drupal_version = $this->getLegacyDrupalVersion($this->migrateConnection)) {
             $io->error($this->trans('commands.migrate.setup.migrations.questions.not-drupal'));
-            return;
+            return 1;
         }
         
         $version_tag = 'Drupal ' . $drupal_version;
@@ -322,7 +315,7 @@ class ExecuteCommand extends Command
         
         if (count($migrations) == 0) {
             $io->error($this->trans('commands.migrate.execute.messages.no-migrations'));
-            return;
+            return 1;
         }
 
         foreach ($migrations as $migration_id) {
@@ -386,7 +379,11 @@ class ExecuteCommand extends Command
                 }
             } else {
                 $io->error($this->trans('commands.migrate.execute.messages.fail-load'));
+
+                return 1;
             }
         }
+
+        return 0;
     }
 }