From a33e635f9e7475d60130786c56dab573be5a198e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 3 Sep 2013 12:59:56 +0800 Subject: [PATCH] JsCompile.php --- JsCompile.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/JsCompile.php b/JsCompile.php index ef7e97fd..f4cd77c4 100644 --- a/JsCompile.php +++ b/JsCompile.php @@ -81,6 +81,16 @@ class Pman_Core_JsCompile extends Pman * */ + function jsSort($a,$b) + { + $a = substr($a, 0, -3); + $b= substr($b, 0, -3); + if ($a == $b) { + return 0; + } + return ($a > $b) ? +1 : -1; + } + function packScript($basedir, $files, $output_url, $compile=true) { @@ -110,15 +120,10 @@ class Pman_Core_JsCompile extends Pman $ofiles [] = $f . '/'. basename($fx); } } + $tf = // sort exc. the .js - usort($ofiles,function($a,$b) { - $a = substr($a, 0, -3); - $b= substr($b, 0, -3); - if ($a == $b) { - return 0; - } - return ($a > $b) ? +1 : -1; - }); + usort($ofiles,create_function('$a,$b', 'return Pman_Core_JsCompile($a,$b);')); + //print_R($ofiles); $output = md5(serialize($arfiles)) .'.js'; -- 2.39.2