diff options
author | emkael <emkael@tlen.pl> | 2016-05-02 23:25:49 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-02 23:25:49 +0200 |
commit | 0d05cd72983ab3e0c9472929915eff16cb8009ac (patch) | |
tree | 04c3af7560f91dba7d2866c9808c2f1cd605756b /app | |
parent | 7619852c75d4e23480e65bb1ad8e824559f94a4d (diff) |
* JS compression factored out to separate method
Diffstat (limited to 'app')
-rw-r--r-- | app/php/web/ClientScriptManager.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/php/web/ClientScriptManager.php b/app/php/web/ClientScriptManager.php index 1a73b3e..0dbdffa 100644 --- a/app/php/web/ClientScriptManager.php +++ b/app/php/web/ClientScriptManager.php @@ -137,6 +137,12 @@ class ClientScriptManager extends TClientScriptManager { ); } + private function _getCompressedScript($path) { + return trim(TJavaScript::JSMin( + file_get_contents($path) + )); + } + private function _compileScriptFiles($files) { foreach ($files as $file) { $this->markScriptFileAsRendered($file); @@ -151,13 +157,7 @@ class ClientScriptManager extends TClientScriptManager { $scriptContent = implode( PHP_EOL, array_map( - function($path) { - return trim( - TJavaScript::JSMin( - file_get_contents($path) - ) - ); - }, + [$this, '_getCompressedScript'], $paths ) ); |