issue 2140, Do not load duplicated front-end file(have .min, no .min in filename)

git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@11270 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-09-17 08:43:49 +00:00
parent 9245557873
commit c4285ba2ed

View file

@ -99,7 +99,23 @@
$pathInfo = pathinfo($args[0]);
$file->fileName = $pathInfo['basename'];
$file->filePath = $this->_getAbsFileUrl($pathInfo['dirname']);
$file->fileRealPath = FileHandler::getRealPath($pathInfo['dirname']);
$file->fileExtension = strtolower($pathInfo['extension']);
$file->fileNameNoExt = preg_replace("/\.{$file->fileExtension}$/", '', $file->fileName);
// Remove .min
$file->fileNameNoExt = preg_replace("/\.min$/", '', $file->fileNameNoExt);
$file->fileName = $file->keyName = "{$file->fileNameNoExt}.{$file->fileExtension}";
// if no debug mode load minified file
if(!__DEBUG__)
{
$tmp = "{$file->fileNameNoExt}.min.{$file->fileExtension}";
if(file_exists("{$file->fileRealPath}/{$tmp}"))
{
$file->fileName = $tmp;
}
}
if (strpos($file->filePath, '://') == false)
{
@ -121,7 +137,7 @@
if (!$file->media) $file->media = 'all';
$map = &$this->cssMap;
$mapIndex = &$this->cssMapIndex;
$key = $file->filePath . $file->fileName . "\t" . $file->targetIe . "\t" . $file->media;
$key = $file->filePath . $file->keyName . "\t" . $file->targetIe . "\t" . $file->media;
$this->_arrangeCssIndex($pathInfo['dirname'], $file);
}
@ -138,7 +154,7 @@
$map = &$this->jsHeadMap;
$mapIndex = &$this->jsHeadMapIndex;
}
$key = $file->filePath . $file->fileName . "\t" . $file->targetIe;
$key = $file->filePath . $file->keyName . "\t" . $file->targetIe;
}
(is_null($file->index))?$file->index=0:$file->index=$file->index;