parent::__construct();
}
- /**
- * @DrupalCommand(
- * dependencies = {
- * "migrate"
- * }
- * )
- */
protected function configure()
{
$this
->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')
);
if (!$drupal_version = $this->getLegacyDrupalVersion($this->migrateConnection)) {
$io->error($this->trans('commands.migrate.setup.migrations.questions.not-drupal'));
- return;
+ return 1;
}
$database = $this->getDBInfo();
// If migrations weren't provided finish execution
if (empty($migration_ids)) {
- return;
+ return 1;
}
if (!$this->migrateConnection) {
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;
if (count($migrations) == 0) {
$io->error($this->trans('commands.migrate.execute.messages.no-migrations'));
- return;
+ return 1;
}
foreach ($migrations as $migration_id) {
}
} else {
$io->error($this->trans('commands.migrate.execute.messages.fail-load'));
+
+ return 1;
}
}
+
+ return 0;
}
}