public function getMergedCssUrl($files) {
$tstamp = $this->getYoungestFile($files);
// secure or unsecure
$isSecure = Mage::app()->getRequest()->isSecure();
$mergerDir = $isSecure ? 'css_secure' : 'css';
$targetDir = $this->_initMergerDir($mergerDir);
if (!$targetDir) {
return '';
}
// base hostname & port
$baseMediaUrl = Mage::getBaseUrl('media', $isSecure);
$hostname = parse_url($baseMediaUrl, PHP_URL_HOST);
$port = parse_url($baseMediaUrl, PHP_URL_PORT);
if (false === $port) {
$port = $isSecure ? 443 : 80;
}
// merge into target file
$targetFilename = md5(implode(',', $files) . "|{$hostname}|{$port}") . '.' . $tstamp . '.css';
if ($this->_mergeFiles($files, $targetDir . DS . $targetFilename, false, array($this, 'beforeMergeCss'), 'css')) {
return $baseMediaUrl . $mergerDir . '/' . $targetFilename;
}
return '';
}