public function File::getResponse in Migrate Plus 8.4
Same name and namespace in other branches
- 8.5 src/Plugin/migrate_plus/data_fetcher/File.php \Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\File::getResponse()
- 8.2 src/Plugin/migrate_plus/data_fetcher/File.php \Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher\File::getResponse()
- 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_fetcherCode
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;
}