class FeedsHTTPFetcherResult in Feeds 8.2
Result of FeedsHTTPFetcher::fetch().
Hierarchy
- class \Drupal\feeds\FeedsResult
- class \Drupal\feeds\FeedsFetcherResult
- class \Drupal\feeds\FeedsHTTPFetcherResult
- class \Drupal\feeds\FeedsFetcherResult
Expanded class hierarchy of FeedsHTTPFetcherResult
1 file declares its use of FeedsHTTPFetcherResult
- FeedsHTTPFetcher.php in lib/
Drupal/ feeds/ Plugin/ feeds/ fetcher/ FeedsHTTPFetcher.php - Contains \Drupal\feeds\Plugin\feeds\fetcher\FeedsHTTPFetcher.
File
- lib/
Drupal/ feeds/ FeedsHTTPFetcherResult.php, line 8
Namespace
Drupal\feedsView source
class FeedsHTTPFetcherResult extends FeedsFetcherResult {
protected $url;
protected $file_path;
protected $timeout;
/**
* Constructor.
*/
public function __construct($url = NULL) {
$this->url = $url;
parent::__construct('');
}
/**
* Overrides FeedsFetcherResult::getRaw();
*/
public function getRaw() {
feeds_include_library('http_request.inc', 'http_request');
$result = http_request_get($this->url, NULL, NULL, NULL, $this->timeout);
if (!in_array($result->code, array(
200,
201,
202,
203,
204,
205,
206,
))) {
throw new \Exception(t('Download of @url failed with code !code.', array(
'@url' => $this->url,
'!code' => $result->code,
)));
}
return $this
->sanitizeRaw($result->data);
}
public function getTimeout() {
return $this->timeout;
}
public function setTimeout($timeout) {
$this->timeout = $timeout;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsFetcherResult:: |
protected | property | ||
FeedsFetcherResult:: |
public | function | Get a path to a temporary file containing the resource provided by the fetcher. | 1 |
FeedsFetcherResult:: |
public | function | Sanitize the file in place. Currently supported sanitizations: | |
FeedsFetcherResult:: |
public | function | Sanitize the raw content string. Currently supported sanitizations: | |
FeedsHTTPFetcherResult:: |
protected | property |
Overrides FeedsFetcherResult:: |
|
FeedsHTTPFetcherResult:: |
protected | property | ||
FeedsHTTPFetcherResult:: |
protected | property | ||
FeedsHTTPFetcherResult:: |
public | function |
Overrides FeedsFetcherResult::getRaw(); Overrides FeedsFetcherResult:: |
|
FeedsHTTPFetcherResult:: |
public | function | ||
FeedsHTTPFetcherResult:: |
public | function | ||
FeedsHTTPFetcherResult:: |
public | function |
Constructor. Overrides FeedsFetcherResult:: |