日韩视频一区二区_日韩一级视频在线观看播放_高清一级淫片a级中文字幕_亚洲欧美日韩另类精品一区二区三区_免费又黄又爽又猛大片午夜_免费观看日本高清a毛片_久久综合亚洲鲁鲁五月天欧美_97影院午夜午夜伦不卡_欧美好看的AAAAA级毛片_欧美三级a做爰在线观看

php壓縮css和js

時間:2014-06-23 來源:天津文率科技有限公司

首先你要知道php 《JSMin》 這個類,壓縮js很方便

css直接去回車就行了

file_put_contents(存放路徑,str_replace(array("\r\n", "\r", "\n"), "", file_get_contents(要壓縮的css文件路徑)));

$Jsmin      =   new \Common\Extend\Jsmin();

file_put_contents(存放路徑, $Jsmin->minify(file_get_contents(要壓縮的js路徑)) );

如有不明白的可以看我的博客,里面有一些php、js、css基礎的教程

韓文博的新浪博客:http://blog.sina.com.cn/u/1783136603

更多網站建設方面的教程可以看經常來看我們的官網,頻繁更新中,天津網站建設 www.w8369.cn
下面是JSMin類

<?php

/**
 * jsmin.php - PHP implementation of Douglas Crockford's JSMin.
 *
 * This is pretty much a direct port of jsmin.c to PHP with just a few
 * PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and
 * outputs to stdout, this library accepts a string as input and returns another
 * string as output.
 *
 * PHP 5 or higher is required.
 *
 * Permission is hereby granted to use this version of the library under the
 * same terms as jsmin.c, which has the following license:
 *
 * --
 * Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * The Software shall be used for Good, not Evil.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * --
 *
 * @package JSMin
 * @author Ryan Grove <ryan@wonko.com>
 * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
 * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
 * @license http://opensource.org/licenses/mit-license.php MIT License
 * @version 1.1.1 (2008-03-02)
 * @link http://code.google.com/p/jsmin-php/
 */
namespace Common\Extend;
class JSMin {
  const ORD_LF    = 10;
  const ORD_SPACE = 32;

  protected $a           = '';
  protected $b           = '';
  protected $input       = '';
  protected $inputIndex  = 0;
  protected $inputLength = 0;
  protected $lookAhead   = null;
  protected $output      = '';

  // -- Public Static Methods --------------------------------------------------

  public static function minify($js) {
    $jsmin = new JSMin($js);
    return $jsmin->min();
  }

  // -- Public Instance Methods ------------------------------------------------

  public function __construct($input) {
    $this->input       = str_replace("\r\n", "\n", $input);
    $this->inputLength = strlen($this->input);
  }

  // -- Protected Instance Methods ---------------------------------------------

  protected function action($d) {
    switch($d) {
      case 1:
        $this->output .= $this->a;

      case 2:
        $this->a = $this->b;

        if ($this->a === "'" || $this->a === '"') {
          for (;;) {
            $this->output .= $this->a;
            $this->a       = $this->get();

            if ($this->a === $this->b) {
              break;
            }

            if (ord($this->a) <= self::ORD_LF) {
              throw new JSMinException('Unterminated string literal.');
            }

            if ($this->a === '\\') {
              $this->output .= $this->a;
              $this->a       = $this->get();
            }
          }
        }

      case 3:
        $this->b = $this->next();

        if ($this->b === '/' && (
            $this->a === '(' || $this->a === ',' || $this->a === '=' ||
            $this->a === ':' || $this->a === '[' || $this->a === '!' ||
            $this->a === '&' || $this->a === '|' || $this->a === '?')) {

          $this->output .= $this->a . $this->b;

          for (;;) {
            $this->a = $this->get();

            if ($this->a === '/') {
              break;
            } elseif ($this->a === '\\') {
              $this->output .= $this->a;
              $this->a       = $this->get();
            } elseif (ord($this->a) <= self::ORD_LF) {
              throw new JSMinException('Unterminated regular expression '.
                  'literal.');
            }

            $this->output .= $this->a;
          }

          $this->b = $this->next();
        }
    }
  }

  protected function get() {
    $c = $this->lookAhead;
    $this->lookAhead = null;

    if ($c === null) {
      if ($this->inputIndex < $this->inputLength) {
        $c = $this->input[$this->inputIndex];
        $this->inputIndex += 1;
      } else {
        $c = null;
      }
    }

    if ($c === "\r") {
      return "\n";
    }

    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
      return $c;
    }

    return ' ';
  }

  protected function isAlphaNum($c) {
    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
  }

  protected function min() {
    $this->a = "\n";
    $this->action(3);

    while ($this->a !== null) {
      switch ($this->a) {
        case ' ':
          if ($this->isAlphaNum($this->b)) {
            $this->action(1);
          } else {
            $this->action(2);
          }
          break;

        case "\n":
          switch ($this->b) {
            case '{':
            case '[':
            case '(':
            case '+':
            case '-':
              $this->action(1);
              break;

            case ' ':
              $this->action(3);
              break;

            default:
              if ($this->isAlphaNum($this->b)) {
                $this->action(1);
              }
              else {
                $this->action(2);
              }
          }
          break;

        default:
          switch ($this->b) {
            case ' ':
              if ($this->isAlphaNum($this->a)) {
                $this->action(1);
                break;
              }

              $this->action(3);
              break;

            case "\n":
              switch ($this->a) {
                case '}':
                case ']':
                case ')':
                case '+':
                case '-':
                case '"':
                case "'":
                  $this->action(1);
                  break;

                default:
                  if ($this->isAlphaNum($this->a)) {
                    $this->action(1);
                  }
                  else {
                    $this->action(3);
                  }
              }
              break;

            default:
              $this->action(1);
              break;
          }
      }
    }

    return $this->output;
  }

  protected function next() {
    $c = $this->get();

    if ($c === '/') {
      switch($this->peek()) {
        case '/':
          for (;;) {
            $c = $this->get();

            if (ord($c) <= self::ORD_LF) {
              return $c;
            }
          }

        case '*':
          $this->get();

          for (;;) {
            switch($this->get()) {
              case '*':
                if ($this->peek() === '/') {
                  $this->get();
                  return ' ';
                }
                break;

              case null:
                throw new JSMinException('Unterminated comment.');
            }
          }

        default:
          return $c;
      }
    }

    return $c;
  }

  protected function peek() {
    $this->lookAhead = $this->get();
    return $this->lookAhead;
  }
}

// -- Exceptions ---------------------------------------------------------------
class JSMinException {}
//class JSMinException extends Exception {}
?>

聯絡方式:

中國 · 天津市河西區南京路35號亞太大廈1403室
電話:15620613686
郵編:300220

国产一区二区精品久久| 国产不卡精品一区二区三区| 国产麻豆精品免费视频| 国产一区免费观看| 在线观看导航| 国产不卡在线看| 国产不卡在线看| 亚飞与亚基在线观看| 午夜在线影院| 日本免费看视频| 成人av在线播放| 一本伊大人香蕉高清在线观看| 精品视频在线观看免费| 亚洲www美色| 999精品视频在线| 国产视频一区在线| 久久99这里只有精品国产| 91麻豆精品国产自产在线| 亚洲女人国产香蕉久久精品 | 麻豆系列国产剧在线观看| 成人影院一区二区三区| 久草免费在线色站| 国产一区二区精品| 美女免费精品视频在线观看| 欧美日本韩国| 国产精品1024永久免费视频 | 高清一级片| 日韩专区亚洲综合久久| 国产成人啪精品视频免费软件| 亚洲天堂免费| 999久久狠狠免费精品| 日本特黄特黄aaaaa大片| 国产欧美精品| 色综合久久手机在线| 色综合久久手机在线| 国产极品精频在线观看| 成人免费观看的视频黄页| 成人高清视频免费观看| 国产精品1024永久免费视频 | 人人干人人插| 亚洲天堂免费| 黄视频网站免费| 国产国语对白一级毛片| 好男人天堂网 久久精品国产这里是免费 国产精品成人一区二区 男人天堂网2021 男人的天堂在线观看 丁香六月综合激情 | 国产视频一区二区在线观看| 91麻豆精品国产高清在线| 91麻豆tv| 国产成人精品影视| 日本伦理黄色大片在线观看网站| 欧美激情影院| 麻豆系列 在线视频| 尤物视频网站在线观看| 精品毛片视频| 精品视频在线观看一区二区| 亚欧乱色一区二区三区| 久草免费在线视频| 欧美a级片视频| 亚洲 国产精品 日韩| 日本免费看视频| 一级毛片视频在线观看| 毛片高清| 国产成人精品在线| 久久精品免视看国产明星| 欧美另类videosbestsex高清| 国产不卡在线观看| 国产91精品系列在线观看| 国产福利免费观看| 国产极品白嫩美女在线观看看| 国产伦久视频免费观看 视频 | 国产不卡在线播放| 精品国产香蕉在线播出 | 国产伦精品一区三区视频| 国产网站免费| 天天做日日爱| 91麻豆国产福利精品| 二级特黄绝大片免费视频大片| 色综合久久天天综合| 沈樵在线观看福利| 国产一区二区精品久久| 黄色免费三级| 欧美一级视| 成人高清护士在线播放| 四虎影视久久| 日韩中文字幕在线观看视频| 青青久久精品国产免费看| 麻豆网站在线免费观看| 四虎论坛| 成人在激情在线视频| 99热精品一区| 国产视频一区在线| 天天色成人| 国产麻豆精品| 日本伦理黄色大片在线观看网站| 999精品在线| 在线观看成人网 | 日韩专区一区| 日本在线播放一区| 亚欧成人乱码一区二区| 精品国产一区二区三区国产馆 | 日韩一级黄色| 亚欧乱色一区二区三区| 欧美激情影院| 久久福利影视| 国产亚洲免费观看| 欧美大片a一级毛片视频| 亚洲 欧美 成人日韩| 国产视频一区二区在线播放| 日日夜夜婷婷| 国产一区二区精品久| 天天做日日爱| 99色播| 国产成人女人在线视频观看| 国产视频一区在线| 麻豆污视频| 成人免费网站久久久| 一级女性全黄久久生活片| 日韩中文字幕一区二区不卡| 国产亚洲免费观看| 国产麻豆精品免费视频| 久久精品人人做人人爽97| 久久精品免视看国产明星| 日韩av片免费播放| 国产国语对白一级毛片| 日本免费看视频| 亚洲爆爽| 日本在线不卡免费视频一区| 亚洲爆爽| 九九久久99综合一区二区| 九九九网站| 午夜家庭影院| 国产一区二区精品久久91| 黄色福利| 精品久久久久久综合网| 成人免费一级毛片在线播放视频| 美女免费精品视频在线观看| 亚洲精品永久一区| 欧美1区| 日本久久久久久久 97久久精品一区二区三区 狠狠色噜噜狠狠狠狠97 日日干综合 五月天婷婷在线观看高清 九色福利视频 | 国产91精品一区| 欧美a免费| 九九热国产视频| 亚洲精品影院一区二区| 国产一区免费在线观看| 九九九网站| 亚欧乱色一区二区三区| 沈樵在线观看福利| 天天色成人网| 人人干人人插| 日韩在线观看免费完整版视频| 超级乱淫伦动漫| 精品久久久久久综合网| 午夜激情视频在线观看| 国产网站免费| 日韩在线观看免费完整版视频| 精品久久久久久中文字幕2017| 黄视频网站在线看| 999精品影视在线观看| 国产精品自拍亚洲| 91麻豆国产福利精品| 国产麻豆精品视频| 国产亚洲免费观看| 国产麻豆精品| 国产91精品露脸国语对白| 精品视频一区二区| 久久国产一区二区| 亚洲 国产精品 日韩| 亚欧乱色一区二区三区| 日韩专区第一页| 国产网站免费观看| 午夜欧美成人香蕉剧场| 99久久精品国产国产毛片| 日韩在线观看视频网站| 黄色免费三级| 国产a一级| 日本在线www| 久久精品欧美一区二区| 免费一级片在线观看| 国产精品免费精品自在线观看| 国产伦理精品| 欧美国产日韩久久久| 91麻豆精品国产片在线观看| 日韩女人做爰大片| 久草免费资源| 久久久成人网| 国产一区二区精品久| 午夜激情视频在线观看| 国产伦久视频免费观看视频| 精品视频一区二区三区免费| 日韩综合| 精品毛片视频| 黄视频网站在线观看| 美女免费精品视频在线观看| 国产亚洲免费观看| 99色视频在线| 欧美一级视| 国产精品免费久久| 国产一区二区精品久久91| 国产一区二区精品尤物| 九九久久99综合一区二区| 中文字幕一区二区三区 精品|