public function HttpAsset::load

Loads the asset into memory and applies load filters.

You may provide an additional filter to apply during load.

Parameters

FilterInterface $additionalFilter An additional filter:

Overrides AssetInterface::load

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php, line 53

Class

HttpAsset
Represents an asset loaded via an HTTP request.

Namespace

Assetic\Asset

Code

public function load(FilterInterface $additionalFilter = null) {
  if (false === ($content = @file_get_contents(PathUtils::resolvePath($this->sourceUrl, $this
    ->getVars(), $this
    ->getValues())))) {
    if ($this->ignoreErrors) {
      return;
    }
    else {
      throw new \RuntimeException(sprintf('Unable to load asset from URL "%s"', $this->sourceUrl));
    }
  }
  $this
    ->doLoad($content, $additionalFilter);
}