You are here

public function FeedsEnclosure::getContent in Feeds 6

Same name and namespace in other branches
  1. 7.2 plugins/FeedsParser.inc \FeedsEnclosure::getContent()
  2. 7 plugins/FeedsParser.inc \FeedsEnclosure::getContent()

Return value

The content of the referenced resource.

1 call to FeedsEnclosure::getContent()
FeedsEnclosure::getFile in plugins/FeedsParser.inc
@todo Get file extension from mime_type. @todo This is not concurrency safe.

File

plugins/FeedsParser.inc, line 249

Class

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

Code

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