You are here

protected function MigrateUpgradeDrushRunner::applyFilePath in Migrate Upgrade 8.2

Same name and namespace in other branches
  1. 8.3 src/MigrateUpgradeDrushRunner.php \Drupal\migrate_upgrade\MigrateUpgradeDrushRunner::applyFilePath()

Adds the source base path configuration to relevant migrations.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: Migration to alter with the provided path.

1 call to MigrateUpgradeDrushRunner::applyFilePath()
MigrateUpgradeDrushRunner::configure in src/MigrateUpgradeDrushRunner.php
From the provided source information, instantiate the appropriate migrations in the active configuration.

File

src/MigrateUpgradeDrushRunner.php, line 97

Class

MigrateUpgradeDrushRunner

Namespace

Drupal\migrate_upgrade

Code

protected function applyFilePath(MigrationInterface $migration) {
  $destination = $migration
    ->getDestinationConfiguration();
  if ($destination['plugin'] === 'entity:file') {

    // Make sure we have a single trailing slash.
    $source_base_path = rtrim(drush_get_option('legacy-root'), '/') . '/';
    $destination['source_base_path'] = $source_base_path;
    $migration
      ->set('destination', $destination);
  }
}