/** * Check if asset in exclude list * * @param LocalInterface $asset * @return bool */ protected function isExcluded(LocalInterface $asset) { $excludedFiles = array_merge($this->bundleConfig->getConfig($asset->getContext())->getExcludedFiles(), $this->excluded); if (in_array($asset->getFilePath(), $excludedFiles)) { return true; } // check if file in excluded directory $assetDirectory = dirname($asset->getFilePath()); foreach ($this->bundleConfig->getConfig($asset->getContext())->getExcludedDir() as $dir) { if (strpos($assetDirectory, $dir) !== false) { return true; } } return false; }
/** * Check if asset in exclude list * * @param LocalInterface $asset * @return bool */ protected function isExcluded(LocalInterface $asset) { $excludedFiles = array_merge($this->bundleConfig->getConfig($asset->getContext())->getExcludedFiles(), $this->excluded); foreach ($excludedFiles as $file) { if ($this->isExcludedFile($file, $asset)) { return true; } } foreach ($this->bundleConfig->getConfig($asset->getContext())->getExcludedDir() as $directory) { if ($this->isExcludedDirectory($directory, $asset)) { return true; } } return false; }