日韩视频一区二区_日韩一级视频在线观看播放_高清一级淫片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

欧美激情一区二区三区在线播放| 九九九在线视频| 黄视频网站在线看| 欧美一级视| 国产亚洲精品成人a在线| 美国一区二区三区| 免费一级生活片| 午夜欧美成人香蕉剧场| 欧美夜夜骑 青草视频在线观看完整版 久久精品99无色码中文字幕 欧美日韩一区二区在线观看视频 欧美中文字幕在线视频 www.99精品 香蕉视频久久 | 91麻豆精品国产片在线观看| 精品视频在线观看视频免费视频 | 国产麻豆精品免费视频| 精品国产香蕉在线播出 | 国产亚洲免费观看| 日韩男人天堂| 九九久久国产精品大片| 国产成人啪精品| 青青久久精品| 四虎影视久久久免费| 99色吧| 久久国产一久久高清| 国产一区免费观看| 日韩中文字幕一区二区不卡| 久久精品店| 麻豆系列国产剧在线观看| 二级片在线观看| 成人高清视频免费观看| 日韩专区第一页| 四虎久久影院| 免费一级生活片| 欧美另类videosbestsex高清| 成人免费观看网欧美片| 国产高清在线精品一区二区| 精品国产一区二区三区久久久蜜臀| 国产91精品一区二区| 亚洲 国产精品 日韩| 欧美激情一区二区三区视频高清| 夜夜操网| 日本乱中文字幕系列| 欧美日本免费| 九九国产| 精品视频免费在线| 国产a网| 国产精品1024永久免费视频| 精品国产亚一区二区三区| 日韩专区第一页| 97视频免费在线| 久久成人亚洲| 日韩av东京社区男人的天堂| 99久久精品国产片| 国产一区二区精品久| 999久久久免费精品国产牛牛| 一级女性全黄生活片免费| 九九热国产视频| 沈樵在线观看福利| 九九九国产| 亚欧视频在线| 日本免费看视频| 日韩av成人| 精品视频在线观看视频免费视频 | 欧美另类videosbestsex高清| 欧美一级视频免费观看| 精品视频在线看| 97视频免费在线观看| 久久99中文字幕久久| 欧美爱爱动态| 日日夜夜婷婷| 黄视频网站在线免费观看| 成人影视在线播放| 四虎影视库| 欧美激情一区二区三区中文字幕| 欧美电影免费看大全| 亚洲 国产精品 日韩| 成人a级高清视频在线观看| 国产精品123| 国产精品自拍亚洲| 日韩中文字幕在线播放| 亚洲精品永久一区| 精品视频一区二区| 天天色成人网| 久久国产精品只做精品| 91麻豆精品国产高清在线| 青青久热| 欧美一级视| 一级毛片视频播放| 亚洲第一色在线| 二级特黄绝大片免费视频大片| 日韩中文字幕在线亚洲一区| 亚洲天堂免费| 日韩免费片| 日韩中文字幕在线观看视频| 天天做人人爱夜夜爽2020| 成人免费观看视频| 亚洲精品影院| 午夜在线亚洲| 午夜家庭影院| 麻豆网站在线看| 国产成人精品综合| 青青青草影院 | 国产美女在线观看| 久久99中文字幕| 国产精品免费久久| 国产91素人搭讪系列天堂| 欧美爱色| 久久精品店| 精品国产一区二区三区久久久蜜臀 | 麻豆午夜视频| 国产成人欧美一区二区三区的| 精品久久久久久中文字幕一区| a级精品九九九大片免费看| 成人av在线播放| 一级毛片视频在线观看| 欧美18性精品| 麻豆系列 在线视频| 国产91精品一区二区| 国产欧美精品| 久草免费资源| 久久99这里只有精品国产| 精品国产亚一区二区三区| 亚洲精品中文字幕久久久久久| 久草免费在线观看| 台湾美女古装一级毛片| 久久99青青久久99久久| 国产网站麻豆精品视频| 四虎影视库| 深夜做爰性大片中文| 九九精品影院| 精品久久久久久中文字幕2017| 免费一级片网站| 毛片的网站| 久久成人亚洲| 日韩一级黄色| 日本乱中文字幕系列| 精品国产亚一区二区三区| 国产视频一区二区在线播放| 欧美日本韩国| 欧美另类videosbestsex视频 | 国产一级强片在线观看| 欧美另类videosbestsex| 欧美a级片免费看| 精品久久久久久影院免费| 日日爽天天| 亚久久伊人精品青青草原2020| 欧美激情一区二区三区视频 | 国产麻豆精品高清在线播放| 精品久久久久久中文字幕一区| 欧美激情影院| 欧美1区| 精品久久久久久免费影院| 日本久久久久久久 97久久精品一区二区三区 狠狠色噜噜狠狠狠狠97 日日干综合 五月天婷婷在线观看高清 九色福利视频 | 日韩专区在线播放| 国产麻豆精品hdvideoss| 久久成人性色生活片| 久久精品店| 99热精品在线| a级毛片免费观看网站| 欧美一级视| 四虎影视库国产精品一区| 免费国产在线观看| 免费一级片网站| 日日夜夜婷婷| 91麻豆爱豆果冻天美星空| 久久精品欧美一区二区| 中文字幕一区二区三区 精品| 欧美另类videosbestsex视频| 国产高清在线精品一区二区 | 久久国产精品自由自在| 精品在线免费播放| 欧美夜夜骑 青草视频在线观看完整版 久久精品99无色码中文字幕 欧美日韩一区二区在线观看视频 欧美中文字幕在线视频 www.99精品 香蕉视频久久 | 成人免费网站久久久| 成人免费高清视频| 日韩免费片| 亚洲精品中文字幕久久久久久| 99热视热频这里只有精品| 欧美另类videosbestsex高清| 麻豆网站在线看| 精品国产三级a| 91麻豆国产福利精品| 免费国产在线观看| 九九精品影院| 国产一级强片在线观看| 日韩免费在线观看视频| 久久久久久久久综合影视网| 亚州视频一区二区| 四虎久久精品国产| 成人免费观看网欧美片| 久久成人亚洲| 久久国产精品永久免费网站| 成人免费网站久久久| 国产成人精品综合| 国产亚洲精品aaa大片| 成人免费福利片在线观看| 久久99青青久久99久久| 日本免费区| 91麻豆精品国产片在线观看| 91麻豆国产福利精品| 一级女性全黄生活片免费| 成人a大片在线观看| 欧美另类videosbestsex视频| 尤物视频网站在线|