41 } elseif (
false === strpos(
$sourceUrl,
'://')) {
42 throw new \InvalidArgumentException(sprintf(
'"%s" is not a valid URL.',
$sourceUrl));
49 list($host,
$path) = explode(
'/',
$url, 2);
60 if (
false ===
$content && !$this->ignoreErrors) {
61 throw new \RuntimeException(sprintf(
'Unable to load asset from URL "%s"', $this->sourceUrl));
69 if (
false !== @file_get_contents($this->sourceUrl,
false, stream_context_create(
array(
'http' =>
array(
'method' =>
'HEAD'))))) {
70 foreach ($http_response_header as
$header) {
71 if (0 === stripos($header,
'Last-Modified: ')) {
72 list(, $mtime) = explode(
':', $header, 2);
74 return strtotime(trim($mtime));
static resolve($template, array $vars, array $values)
Resolves variable placeholders.
load(FilterInterface $additionalFilter=null)
Loads the asset into memory and applies load filters.
__construct($sourceUrl, $filters=array(), $ignoreErrors=false, array $vars=array())
Constructor.
doLoad($content, FilterInterface $additionalFilter=null)
Encapsulates asset loading logic.
Represents an asset loaded via an HTTP request.
A filter manipulates an asset at load and dump.
getVars()
Returns an array of variable names for this asset.
getLastModified()
Returns the time the current asset was last modified.
Create styles array
The data for the language used.
getValues()
Returns the current values for this asset.