You are here

protected function EntityFile::isLocationUnchanged in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Plugin/migrate/destination/EntityFile.php \Drupal\file\Plugin\migrate\destination\EntityFile::isLocationUnchanged()

Returns if the source and destination URIs represent identical paths. If either URI is a remote stream, will return FALSE.

Parameters

string $source: The source URI.

string $destination: The destination URI.

Return value

bool TRUE if the source and destination URIs refer to the same physical path, otherwise FALSE.

1 call to EntityFile::isLocationUnchanged()
EntityFile::import in core/modules/file/src/Plugin/migrate/destination/EntityFile.php
Import the row.

File

core/modules/file/src/Plugin/migrate/destination/EntityFile.php, line 224
Contains \Drupal\file\Plugin\migrate\destination\EntityFile.

Class

EntityFile
Every migration that uses this destination must have an optional dependency on the d6_file migration to ensure it runs first.

Namespace

Drupal\file\Plugin\migrate\destination

Code

protected function isLocationUnchanged($source, $destination) {
  if ($this
    ->isLocalUri($source) && $this
    ->isLocalUri($destination)) {
    return $this->fileSystem
      ->realpath($source) === $this->fileSystem
      ->realpath($destination);
  }
  else {
    return FALSE;
  }
}