You are here

public function File::getResponse in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/migrate_plus/data_fetcher/File.php \Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\File::getResponse()
  2. 8.2 src/Plugin/migrate_plus/data_fetcher/File.php \Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\File::getResponse()
  3. 8.3 src/Plugin/migrate_plus/data_fetcher/File.php \Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\File::getResponse()

Return Http Response object for a given url.

Parameters

string $url: URL to retrieve from.

Return value

\Psr\Http\Message\ResponseInterface The HTTP response message.

Overrides DataFetcherPluginInterface::getResponse

1 call to File::getResponse()
File::getResponseContent in src/Plugin/migrate_plus/data_fetcher/File.php
Return content.

File

src/Plugin/migrate_plus/data_fetcher/File.php, line 36

Class

File
Retrieve data from a local path or general URL for migration.

Namespace

Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher

Code

public function getResponse($url) {
  $response = @file_get_contents($url);
  if ($response === FALSE) {
    throw new MigrateException('file parser plugin: could not retrieve data from ' . $url);
  }
  return $response;
}