You are here

protected function FileImport::getDestinationFilePath in Migrate Files (extended) 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/migrate/process/FileImport.php \Drupal\migrate_file\Plugin\migrate\process\FileImport::getDestinationFilePath()

Build the destination filename.

Parameters

string $source: The source URI.

string $destination: The destination URI.

Return value

boolean Whether or not the file exists.

1 call to FileImport::getDestinationFilePath()
FileImport::transform in src/Plugin/migrate/process/FileImport.php
Performs the associated process.

File

src/Plugin/migrate/process/FileImport.php, line 325

Class

FileImport
Imports a file from an local or external source.

Namespace

Drupal\migrate_file\Plugin\migrate\process

Code

protected function getDestinationFilePath($source, $destination) {
  if ($this
    ->isDirectory($destination)) {
    $parsed_url = parse_url($source);
    $filepath = $destination . drupal_basename($parsed_url['path']);
  }
  else {
    $filepath = $destination;
  }
  return $filepath;
}