예제 #1
0
 public static function minify($code, $options = array())
 {
     // @todo: set encoding options based on $options :)
     $packer = new JavascriptPacker($code, 'Normal', true, false);
     return trim($packer->pack());
 }
예제 #2
0
 /**
  * 压缩js文件
  *
  * @author          mrmsl <*****@*****.**>
  * @date            2012-07-10 15:59:37
  * @lastmodify      2013-01-22 10:52:51 by mrmsl
  *
  * @param string $filename 文件名
  *
  * @return void 无返回值
  */
 private function _packFile($filename)
 {
     $packer = new JavascriptPacker(file_get_contents($filename));
     $packed = $packer->pack();
     file_put_contents(PACKER_JS_PATH . 'pack/' . basename($filename, '.js') . '.pack.js', $packed);
     unset($packer, $packed);
 }
예제 #3
0
 /**
  * 压缩js文件
  *
  * @author          mrmsl <*****@*****.**>
  * @date            2012-07-10 15:59:37
  * @lastmodify      2013-01-22 10:52:51 by mrmsl
  *
  * @param string $filename 文件名
  *
  * @return void 无返回值
  */
 private function _packFile($filename)
 {
     $packer = new JavascriptPacker(file_get_contents($filename));
     $packed = $packer->pack();
     file_put_contents(substr_replace($filename, '.min.js', -3), $packed);
     unset($packer, $packed);
 }
예제 #4
0
파일: Packer.php 프로젝트: 119155012/kals
 public static function minify($code, $options = array())
 {
     // todo: set encoding options based on $options :) @author Pulipuli Chen <*****@*****.**> 20151102
     $packer = new JavascriptPacker($code, 'Normal', true, false);
     return trim($packer->pack());
 }