Exemplo n.º 1
0
 /**
  * Create static assets.
  *
  * @param string[] $paths Collection of paths for gathering assets
  *
  * @return string[] Cached assets full paths collection
  */
 public function manage(array $paths)
 {
     $this->assets = [];
     // Iterate all assets for analyzing
     foreach ($this->fileManager->scan($paths, self::TYPES, self::$excludeFolders) as $asset) {
         // Build path to processed asset
         $cachedAsset = $this->getAssetProcessedPath($asset);
         // If cached assets was modified or new
         if (!$this->isValid($asset, $cachedAsset)) {
             // Recursively process asset and possible dependencies
             $this->processAsset([$asset => []]);
         }
         // Store processed asset
         $this->assets[pathinfo($cachedAsset, PATHINFO_EXTENSION)][] = $cachedAsset;
     }
     return $this->assets;
 }