File.php in Migrate Plus 8.2
File
src/Plugin/migrate_plus/data_fetcher/File.php
View source
<?php
namespace Drupal\migrate_plus\Plugin\migrate_plus\data_fetcher;
use Drupal\migrate\MigrateException;
use Drupal\migrate_plus\DataFetcherPluginBase;
class File extends DataFetcherPluginBase {
public function setRequestHeaders(array $headers) {
}
public function getRequestHeaders() {
return [];
}
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;
}
public function getResponseContent($url) {
$response = $this
->getResponse($url);
return $response;
}
}
Classes
Name |
Description |
File |
Retrieve data from a local path or general URL for migration. |