Ejemplo n.º 1
0
 /**
  * @param LocalInterface $asset
  * @return bool
  */
 protected function isAssetMinification(LocalInterface $asset)
 {
     $sourceFile = $asset->getSourceFile();
     if (in_array($asset->getFilePath(), $this->excluded)) {
         return false;
     }
     if ($this->assetConfig->isAssetMinification($asset->getContentType())) {
         if (strpos($sourceFile, '.min.') !== false) {
             $this->excluded[] = str_replace('.min.', '', $sourceFile);
             return true;
         }
         $extension = $asset->getContentType();
         $minAbsolutePath = str_replace($extension, "min.{$extension}", $sourceFile);
         if (file_exists($minAbsolutePath)) {
             return false;
         }
         return true;
     }
     if (strpos($sourceFile, '.min.') !== false) {
         $absolutePath = str_replace('.min.', '', $asset->getFilePath());
         if (file_exists($absolutePath)) {
             return false;
         }
     } else {
         $extension = $asset->getContentType();
         $this->excluded[] = str_replace($extension, "min.{$extension}", $asset->getFilePath());
     }
     return true;
 }