mirror of
https://github.com/mrclay/minify.git
synced 2025-09-02 10:22:50 +02:00
Fix error code candling, allow ALL options
This commit is contained in:
@@ -68,8 +68,9 @@ class Minify_FastClosureCompiler {
|
|||||||
// broke the connection and returns 227 instead of 0
|
// broke the connection and returns 227 instead of 0
|
||||||
// We'll just handle this here instead of fixing
|
// We'll just handle this here instead of fixing
|
||||||
// the nailgun client itself.
|
// the nailgun client itself.
|
||||||
if ($result_code != 0 || $result_code != 227) {
|
if ($result_code != 0 && $result_code != 227) {
|
||||||
throw new Exception('Minify_FastClosureCompiler : Closure Compiler execution failed.');
|
throw new Exception('Minify_FastClosureCompiler : Closure Compiler execution failed.');
|
||||||
|
|
||||||
}
|
}
|
||||||
return implode("\n", $output);
|
return implode("\n", $output);
|
||||||
}
|
}
|
||||||
@@ -88,10 +89,8 @@ class Minify_FastClosureCompiler {
|
|||||||
? " --charset {$o['charset']}"
|
? " --charset {$o['charset']}"
|
||||||
: '');
|
: '');
|
||||||
|
|
||||||
foreach (array('compilation_level') as $opt) {
|
foreach ($o as $key => $value) {
|
||||||
if ($o[$opt]) {
|
$cmd .= " --{$key} ". escapeshellarg($value);
|
||||||
$cmd .= " --{$opt} ". escapeshellarg($o[$opt]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $cmd . ' ' . escapeshellarg($tmpFile);
|
return $cmd . ' ' . escapeshellarg($tmpFile);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user