Skip to content

Commit 11482ac

Browse files
author
Jacob Alberty
committed
Added 'sort' option to disable sorting of js files
1 parent b375b10 commit 11482ac

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/tureki/PhpCc.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public function __construct($options)
3838
'jar_file' => __DIR__.'/vendor/closure-compiler/compiler.jar',
3939
'output_path' => '/',
4040
'optimization' => 'SIMPLE_OPTIMIZATIONS',
41-
'charset' => 'utf-8'
41+
'charset' => 'utf-8',
42+
'sort' => true,
4243
);
4344

4445
$this->options = array_merge($this->options,$options);
@@ -127,7 +128,11 @@ public function exec($filename = 'all.min.js')
127128

128129
$this->js_files = array_unique($this->js_files);
129130

130-
sort($this->js_files);
131+
$opt = $this->_get_options();
132+
133+
if ($opt['sort']) {
134+
sort($this->js_files);
135+
}
131136

132137
$num_js = count($this->js_files);
133138

@@ -346,4 +351,4 @@ private function _get_options()
346351
}
347352

348353
}
349-
?>
354+
?>

0 commit comments

Comments
 (0)