public function MigrateUpgradeDrushRunner::import in Migrate Upgrade 8
Same name and namespace in other branches
- 8.3 src/MigrateUpgradeDrushRunner.php \Drupal\migrate_upgrade\MigrateUpgradeDrushRunner::import()
- 8.2 src/MigrateUpgradeDrushRunner.php \Drupal\migrate_upgrade\MigrateUpgradeDrushRunner::import()
Run the configured migrations.
File
- src/
MigrateUpgradeDrushRunner.php, line 54 - Contains \Drupal\migrate_upgrade\MigrateUpgradeDrushRunner.
Class
Namespace
Drupal\migrate_upgradeCode
public function import() {
static::$messages = new DrushLogMigrateMessage();
if (drush_get_option('debug')) {
\Drupal::service('event_dispatcher')
->addListener(MigrateEvents::IDMAP_MESSAGE, [
get_class(),
'onIdMapMessage',
]);
}
foreach ($this->migrationList as $migration_id) {
/** @var MigrationInterface $migration */
$migration = Migration::load($migration_id);
drush_print(dt('Upgrading @migration', [
'@migration' => $migration_id,
]));
$executable = new MigrateExecutable($migration, static::$messages);
// drush_op() provides --simulate support.
drush_op([
$executable,
'import',
]);
}
}