/** * @param UIAsset $uiAsset */ public function addUIAsset($uiAsset) { $location = $uiAsset->getAbsoluteLocation(); if (!$this->assetAlreadyInCatalog($location)) { $this->existingAssetLocations[] = $location; $this->uiAssets[] = $uiAsset; } }
/** * @param UIAsset $uiAsset * @return boolean */ private function assetAlreadyInCatalog($uiAsset) { foreach ($this->uiAssets as $existingAsset) { if ($uiAsset->getAbsoluteLocation() == $existingAsset->getAbsoluteLocation()) { return true; } } return false; }
/** * @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; }