首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > PHP > php 使用 yui compressor 压缩或批量压缩 js和css文件的类

php 使用 yui compressor 压缩或批量压缩 js和css文件的类

资 源 简 介

你可能还需要 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:wwwhtdocsyuicompressor.jar", "save_path"=>"D:wwwhtdocs esults", //必须有可写权限 // -------- 全局设置 --------- // "charset"=>"utf-8", //文件的编码 "line-break"=>false, //在指定的列后插入一个 line-bread 符号 // -------- javascript 代码
VIP VIP
0.182138s