64 private $minification;
84 $this->minification = $minification;
95 $excludedFiles = array_merge(
96 $this->bundleConfig->getConfig($asset->
getContext())->getExcludedFiles(),
99 foreach ($excludedFiles as $file) {
100 if ($this->isExcludedFile($file, $asset)) {
105 foreach ($this->bundleConfig->getConfig($asset->
getContext())->getExcludedDir() as $directory) {
106 if ($this->isExcludedDirectory($directory, $asset)) {
120 protected function isExcludedDirectory($directoryPath, $asset)
123 $assetDirectory = dirname($asset->getFilePath());
124 $assetDirectory .= substr($assetDirectory, -1) !=
'/' ?
'/' :
'';
125 $directoryPath .= substr($directoryPath, -1) !=
'/' ?
'/' :
'';
128 $directoryPathInfo = $this->
splitPath($directoryPath);
129 if ($directoryPathInfo && $this->compareModules($directoryPathInfo, $asset)) {
130 return strpos($assetDirectory, $directoryPathInfo[
'excludedPath']) === 0;
142 protected function isExcludedFile($filePath, $asset)
145 $filePathInfo = $this->
splitPath($filePath);
146 if ($filePathInfo && $this->compareModules($filePathInfo, $asset)) {
147 return $asset->getFilePath() == $filePathInfo[
'excludedPath'];
159 protected function compareModules($filePathInfo, $asset)
162 if (($filePathInfo[
'excludedModule'] ==
'Lib' && $asset->getModule() ==
'')
163 || ($filePathInfo[
'excludedModule'] == $asset->getModule())
178 if (strpos(
$path,
'::') !==
false) {
179 list($excludedModule, $excludedPath) = explode(
'::',
$path);
181 'excludedModule' => $excludedModule,
182 'excludedPath' => $excludedPath,
200 $this->bundle->addAsset($asset);
212 if (in_array($sourceFile, $this->excluded)) {
216 if (strpos($sourceFile,
'.min.') ===
false) {
218 $assetMinifiedPath =
$info[
'dirname'] .
'/' .
$info[
'filename'] .
'.min.' .
$info[
'extension'];
219 if ($this->filesystem->getDirectoryRead(
DirectoryList::APP)->isExist($assetMinifiedPath)) {
220 $this->excluded[] = $sourceFile;
225 ->getAbsolutePath(str_replace(
".min.$extension",
".$extension", $asset->
getPath()));
253 if (!in_array(
$type, self::$availableTypes)) {
267 $this->bundle->flush();
isAssetMinification(LocalInterface $asset)
isExcluded(LocalInterface $asset)
addAsset(LocalInterface $asset)
__construct(Filesystem $filesystem, Bundle $bundle, Bundle\ConfigInterface $bundleConfig, Asset\ConfigInterface $assetConfig, Asset\Minification $minification)
isValidType(LocalInterface $asset)
foreach( $_productCollection as $_product)() ?>" class $info
isValidAsset(LocalInterface $asset)