37 $this->globs = (array)
$globs;
38 $this->initialized =
false;
45 if (!$this->initialized) {
54 if (!$this->initialized) {
58 parent::load($additionalFilter);
63 if (!$this->initialized) {
67 return parent::dump($additionalFilter);
72 if (!$this->initialized) {
76 return parent::getLastModified();
81 if (!$this->initialized) {
85 return parent::getIterator();
91 $this->initialized =
false;
99 foreach ($this->globs as $glob) {
102 if (
false !== $paths = glob($glob)) {
103 foreach ($paths as
$path) {
104 if (is_file(
$path)) {
113 $this->initialized =
true;
getVars()
Returns an array of variable names for this asset.
add(AssetInterface $asset)
Adds an asset to the current collection.
getValues()
Returns the current values for this asset.
getSourceRoot()
Returns an absolute path or URL to the source asset's root directory.
Represents an asset loaded from a file.
A collection of assets loaded by glob.
__construct($globs, $filters=array(), $root=null, array $vars=array())
Constructor.
dump(FilterInterface $additionalFilter=null)
Applies dump filters and returns the asset as a string.
getIterator()
Returns an iterator for looping recursively over unique leaves.
initialize()
Initializes the collection based on the glob(s) passed in.
load(FilterInterface $additionalFilter=null)
Loads the asset into memory and applies load filters.
all()
Returns all child assets.
setValues(array $values)
Sets the values for the asset's variables.
getLastModified()
Returns the highest last-modified value of all assets in the current collection.
static resolve($template, array $vars, array $values)
Resolves variable placeholders.
An exception for terminatinating execution or to throw for unit testing.
A filter manipulates an asset at load and dump.