class FeedsHTTPBatch in Feeds 7
Same name and namespace in other branches
- 6 plugins/FeedsHTTPFetcher.inc \FeedsHTTPBatch
Definition of the import batch object created on the fetching stage by FeedsHTTPFetcher.
Hierarchy
- class \FeedsBatch
- class \FeedsImportBatch
- class \FeedsHTTPBatch
- class \FeedsImportBatch
Expanded class hierarchy of FeedsHTTPBatch
File
- plugins/
FeedsHTTPFetcher.inc, line 14
View source
class FeedsHTTPBatch extends FeedsImportBatch {
protected $url;
protected $file_path;
/**
* Constructor.
*/
public function __construct($url = NULL, $feed_nid) {
$this->url = $url;
parent::__construct('', $feed_nid);
}
/**
* Implements FeedsImportBatch::getRaw();
*/
public function getRaw() {
feeds_include_library('http_request.inc', 'http_request');
$result = http_request_get($this->url);
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 $result->data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsBatch:: |
protected | property | ||
FeedsBatch:: |
protected | property | ||
FeedsBatch:: |
public | function | Report progress. | |
FeedsBatch:: |
public | function | Get the total for a stage. | |
FeedsBatch:: |
public | function | Set progress for a stage. | |
FeedsBatch:: |
public | function | Set the total for a stage. | |
FeedsHTTPBatch:: |
protected | property |
Overrides FeedsImportBatch:: |
|
FeedsHTTPBatch:: |
protected | property | ||
FeedsHTTPBatch:: |
public | function |
Implements FeedsImportBatch::getRaw(); Overrides FeedsImportBatch:: |
|
FeedsHTTPBatch:: |
public | function |
Constructor. Overrides FeedsImportBatch:: |
|
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
public | function | Add an item. | |
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | Return the feed node related to this batch object. | |
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | Get a path to a temporary file containing the resource provided by the fetcher. | 1 |
FeedsImportBatch:: |
public | function | Get number of items. | |
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | Set description. | |
FeedsImportBatch:: |
public | function | Set items. | |
FeedsImportBatch:: |
public | function | Set link. | |
FeedsImportBatch:: |
public | function | Set title. | |
FeedsImportBatch:: |
public | function | @todo Move to a nextItem() based approach, not consuming the item array. Can only be done once we don't cache the entire batch object between page loads for batching anymore. |