Index: units/helpers/minifiers/minify_helper.php =================================================================== --- units/helpers/minifiers/minify_helper.php (revision 13756) +++ units/helpers/minifiers/minify_helper.php (working copy) @@ -199,6 +199,23 @@ */ function compressString(&$string, $extension) { + $tmp_file = tempnam('/tmp', 'to_compress_'); + $fp = fopen($tmp_file, 'w'); + fwrite($fp, $string); + fclose($fp); + + $command = 'java -jar ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'yuicompressor-2.4.2.jar --type ' . $extension . ' --charset utf-8 ' . $tmp_file; + $compressed_string = shell_exec($command); + + unlink($tmp_file); + + if (!is_null($compressed_string)) { + $string = $compressed_string; + return ; + } + + // failed to compress using YUICompressor (maybe java not installed) + if ($extension == 'js') { $minifier =& $this->Application->makeClass('JsMinifyHelper'); /* @var $minifier JsMinifyHelper */