private function GlobAsset::initialize

Initializes the collection based on the glob(s) passed in.

5 calls to GlobAsset::initialize()

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php, line 97

Class

GlobAsset
A collection of assets loaded by glob.

Namespace

Assetic\Asset

Code

private function initialize() {
  foreach ($this->globs as $glob) {
    $glob = VarUtils::resolve($glob, $this
      ->getVars(), $this
      ->getValues());
    if (false !== ($paths = glob($glob))) {
      foreach ($paths as $path) {
        if (is_file($path)) {
          $this
            ->add(new FileAsset($path, array(), $this
            ->getSourceRoot()));
        }
      }
    }
  }
  $this->initialized = true;
}