diff options
-rw-r--r-- | app/php/web/ClientScriptManager.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/php/web/ClientScriptManager.php b/app/php/web/ClientScriptManager.php index 792961b..a0fe657 100644 --- a/app/php/web/ClientScriptManager.php +++ b/app/php/web/ClientScriptManager.php @@ -306,6 +306,16 @@ class ClientScriptManager extends TClientScriptManager { ); } + private function _getCompressedSheet($origPath, $path) { + Prado::using('Lib.cssmin.CssMin'); + return trim(CssMin::minify( + $this->_fixStyleSheetPaths( + file_get_contents($path), + $origPath + ) + )); + } + private function _compileSheetFiles($files) { $paths = $this->_getBasePaths( array_map('reset', $files) @@ -314,20 +324,10 @@ class ClientScriptManager extends TClientScriptManager { $cacheFile = $this->_getCacheFilePath($cacheKey . '.css', 'styles'); $this->_appendRenderedSheets($files, $cacheFile); if (!$this->_isCacheValid($cacheFile, $paths)) { - Prado::using('Lib.cssmin.CssMin'); $styleContent = implode( PHP_EOL, array_map( - function($origPath, $path) { - return trim( - CssMin::minify( - $this->_fixStyleSheetPaths( - file_get_contents($path), - $origPath - ) - ) - ); - }, + [$this, '_getCompressedSheet'], array_keys($paths), $paths ) |