You are here

public function FeedsEnclosure::getContent in Feeds 8.2

Return value

The content of the referenced resource.

1 call to FeedsEnclosure::getContent()
FeedsEnclosure::getFile in lib/Drupal/feeds/FeedsEnclosure.php
Get a Drupal file object of the enclosed resource, download if necessary.

File

lib/Drupal/feeds/FeedsEnclosure.php, line 62

Class

FeedsEnclosure
Enclosure element, can be part of the result array.

Namespace

Drupal\feeds

Code

public function getContent() {
  feeds_include_library('http_request.inc', 'http_request');
  $result = http_request_get($this
    ->getUrlEncodedValue());
  if ($result->code != 200) {
    throw new Exception(t('Download of @url failed with code !code.', array(
      '@url' => $this
        ->getUrlEncodedValue(),
      '!code' => $result->code,
    )));
  }
  return $result->data;
}