Skip to content

Commit

Permalink
reworking compressors
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Oct 7, 2009
1 parent 3122ea1 commit b93930c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 2 additions & 3 deletions compressors/jsmin.php
@@ -1,8 +1,7 @@
<?php

include_once 'compressors/jsmin-1.1.1.php';

function jsmin($script){
function jsmin($script, $path, $root){
include_once $root.'compressors/jsmin-1.1.1.php';
return JSMin::minify($script);
}

Expand Down
9 changes: 6 additions & 3 deletions compressors/yui.php
@@ -1,8 +1,11 @@
<?php

function yui($input){
exec("java -jar compressors/yuicompressor-2.3.5.jar --preserve-semi --line-break 150 --charset UTF-8 $input 2>&1", $out, $err);
return $out;
function yui($input, $path, $root){
$file = $root."compressors/yuicompressor-2.4.2.jar";
if (!file_exists($file)) die('Could not load file: '.$file);
if (!file_exists($path)) die('Could not load file: '.$path);
exec("java -jar ".$file." --preserve-semi -v --line-break 150 --charset UTF-8 ".$path."", $out, $err);
return join($out, PHP_EOL);
}

?>

0 comments on commit b93930c

Please sign in to comment.