Ejemplo n.º 1
0
 /**
  * @param UIAsset $uiAsset
  */
 public function addUIAsset($uiAsset)
 {
     $location = $uiAsset->getAbsoluteLocation();
     if (!$this->assetAlreadyInCatalog($location)) {
         $this->existingAssetLocations[] = $location;
         $this->uiAssets[] = $uiAsset;
     }
 }
Ejemplo n.º 2
0
 /**
  * @param UIAsset $uiAsset
  * @return boolean
  */
 private function assetAlreadyInCatalog($uiAsset)
 {
     foreach ($this->uiAssets as $existingAsset) {
         if ($uiAsset->getAbsoluteLocation() == $existingAsset->getAbsoluteLocation()) {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 3
0
 /**
  * @return boolean
  */
 private function isFileUpToDate()
 {
     $f = fopen($this->mergedAsset->getAbsoluteLocation(), 'r');
     $firstLine = fgets($f);
     fclose($f);
     if (!empty($firstLine) && trim($firstLine) == trim($this->getCacheBusterValue())) {
         return true;
     }
     // Some CSS file in the merge, has changed since last merged asset was generated
     // Note: we do not detect changes in @import'ed LESS files
     return false;
 }