You are here

public function FeedsHTTPFetcher::fetch in Feeds 8.2

Implements FeedsFetcher::fetch().

Overrides FeedsFetcher::fetch

File

lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsHTTPFetcher.php, line 35
Contains \Drupal\feeds\Plugin\feeds\fetcher\FeedsHTTPFetcher.

Class

FeedsHTTPFetcher
Defines an HTTP fetcher.

Namespace

Drupal\feeds\Plugin\feeds\fetcher

Code

public function fetch(FeedsSource $source) {
  $source_config = $source
    ->getConfigFor($this);
  if ($this->config['use_pubsubhubbub'] && ($raw = $this
    ->subscriber($source->feed_nid)
    ->receive())) {
    return new FeedsFetcherResult($raw);
  }
  $fetcher_result = new FeedsHTTPFetcherResult($source_config['source']);

  // When request_timeout is empty, the global value is used.
  $fetcher_result
    ->setTimeout($this->config['request_timeout']);
  return $fetcher_result;
}