你可能还需要
php closure complier :http://code.google.com/p/php-closure-complier-class/
演示地址(DEMO) http://ganquan.info/yui/ (yui online compressor)
php 使用 yuicompressor 压缩或批量压缩 js和css类.
本类通过 windows 和 linux平台测试 有任何问题请反馈到:http://ganquan.info/
使用方式:
```
/*
* PHP YUICompressor Class (Dual licensed under the MIT)
* 风吟 (http://ganquan.info/)
* DEMO http://ganquan.info/yui/ (yui online compressor)
----------------------------------------------------------
要求: dk 1.4+ php exec()
作用: 使用 yuicompressor 批量压缩一个目录的 js 或者 css 文件.也可以对单个文件进行压缩
----------------------------------------------------------
//Windows 调用方式:
$yui = new yuicompressor(array(
'java_home'=>'java', //或自己指定 jdk 安装的 bin 目录 (绝对路径)
'jar_file'=>'D:\www\htdocs\yuicompressor.jar',
'save_path'=>'D:\www\htdocs\results\', //必须有可写权限
// -------- 全局设置 --------- //
'charset'=>'utf-8', //文件的编码
'line-break'=>false, //在指定的列后插入一个 line-bread 符号
// -------- javascript 代码