public function getTags(array $assetsInfo = array(), $concatenation = false)
{
$tags = [];
if ($concatenation) {
$filesToCompress = [];
foreach ($assetsInfo as $asset) {
if ($asset->getPath()) {
// load css files, that are not accessible (means those point to a controller)
// because those can't be compressed
$localPath = $this->getAssetPath($asset->getPath());
if (!file_exists($localPath)) {
$tags[] = $this->getTag($asset);
continue;
}
}
if ($asset->getContent()) {
// load inline assets because we can't compress those
$tags[] = $this->getTag($asset);
continue;
}
if (!$asset->isCompressionAllowed()) {
$tags[] = $this->getTag($asset);
continue;
}
$filesToCompress[] = $asset->getPath();
}
if ($filesToCompress) {
$tags[] = $this->getTag($this->compressFiles($filesToCompress));
}
} else {
foreach ($assetsInfo as $asset) {
$tags[] = $this->getTag($asset);
}
}
return implode("\n", $tags);
}