summaryrefslogtreecommitdiff
path: root/app/php/components/ClientScriptManager.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-22 16:44:17 +0200
committeremkael <emkael@tlen.pl>2016-04-22 16:44:17 +0200
commitf344237346e952cb052f690ff7732f2aab1f065f (patch)
treeb02b468cd81b965293af8ac69ec990e702602f29 /app/php/components/ClientScriptManager.php
parentee96b029b7e5edc4ed6ddbfccf9df44b4c9e45e8 (diff)
* JS minification on compilation
Diffstat (limited to 'app/php/components/ClientScriptManager.php')
-rw-r--r--app/php/components/ClientScriptManager.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/php/components/ClientScriptManager.php b/app/php/components/ClientScriptManager.php
index cd948a6..84b9d6f 100644
--- a/app/php/components/ClientScriptManager.php
+++ b/app/php/components/ClientScriptManager.php
@@ -120,7 +120,16 @@ class ClientScriptManager extends TClientScriptManager {
< $this->_getFileCollectionMTime($paths))) {
$scriptContent = implode(
PHP_EOL,
- array_map('file_get_contents', $paths)
+ array_map(
+ function($path) {
+ return trim(
+ TJavaScript::JSMin(
+ file_get_contents($path)
+ )
+ );
+ },
+ $paths
+ )
);
file_put_contents($cacheFile, $scriptContent);
}