You are here

protected function FileCopy::isLocalUri in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/process/FileCopy.php \Drupal\migrate\Plugin\migrate\process\FileCopy::isLocalUri()
  2. 9 core/modules/migrate/src/Plugin/migrate/process/FileCopy.php \Drupal\migrate\Plugin\migrate\process\FileCopy::isLocalUri()

Determines if the given URI or path is considered local.

A URI or path is considered local if it either has no scheme component, or the scheme is implemented by a stream wrapper which extends \Drupal\Core\StreamWrapper\LocalStream.

Parameters

string $uri: The URI or path to test.

Return value

bool

1 call to FileCopy::isLocalUri()
FileCopy::transform in core/modules/migrate/src/Plugin/migrate/process/FileCopy.php
Performs the associated process.

File

core/modules/migrate/src/Plugin/migrate/process/FileCopy.php, line 247

Class

FileCopy
Copies or moves a local file from one place into another.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

protected function isLocalUri($uri) {
  $scheme = StreamWrapperManager::getScheme($uri);

  // The vfs scheme is vfsStream, which is used in testing. vfsStream is a
  // simulated file system that exists only in memory, but should be treated
  // as a local resource.
  if ($scheme == 'vfs') {
    $scheme = FALSE;
  }
  return $scheme === FALSE || $this->streamWrapperManager
    ->getViaScheme($scheme) instanceof LocalStream;
}