You are here

protected function MigrateUpgradeDrushRunner::applyFilePath in Migrate Upgrade 8.3

Same name and namespace in other branches
  1. 8.2 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, configure the appropriate migrations.

File

src/MigrateUpgradeDrushRunner.php, line 189

Class

MigrateUpgradeDrushRunner
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($this->options['legacy-root'], '/') . '/';
    $source = $migration
      ->getSourceConfiguration();
    $source['constants']['source_base_path'] = $source_base_path;
    $migration
      ->set('source', $source);
  }
}