/**
  * Initializes the collection based on the glob(s) passed in.
  */
 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)) {
                     $asset = new FileAsset($path, array(), $this->getSourceRoot(), null, $this->getVars());
                     $asset->setValues($this->getValues());
                     $this->add($asset);
                 }
             }
         }
     }
     $this->initialized = true;
 }
Example #2
0
 /**
  * Initializes the collection based on the glob(s) passed in.
  */
 private function initialize()
 {
     foreach ($this->globs as $glob) {
         $glob = VarUtils::resolve($glob, $this->getVars(), $this->getValues());
         // handle recursive globs
         $paths = false;
         if ($this->recursive) {
             $paths = $this->rglob($glob, GLOB_NOSORT);
         } else {
             $paths = glob($glob, GLOB_NOSORT);
         }
         if (false !== $paths) {
             foreach ($paths as $path) {
                 if (is_file($path)) {
                     $asset = new FileAsset($path, array(), $this->getSourceRoot(), null, $this->getVars());
                     $asset->setValues($this->getValues());
                     $this->add($asset);
                 }
             }
         }
     }
     $this->initialized = true;
 }