天天插天天日天天操天天干-精品宅男噜噜噜久久久-国产一区 亚洲一区-日韩一级特黄av在线-5566中文字幕丝袜人妻-久久久久久久国产精品电影-一本色道久久88—综合亚洲-中文字幕亚洲一区久久-国产三级一区二区在线观看,99国产久久精品,久久中文字幕不卡视频,精品人妻一区二区91

php壓縮css和js

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

首先你要知道php 《JSMin》 這個(gè)類,壓縮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基礎(chǔ)的教程

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

更多網(wǎng)站建設(shè)方面的教程可以看經(jīng)常來看我們的官網(wǎng),頻繁更新中,天津網(wǎng)站建設(shè) www.chinaaobo.com
下面是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 {}
?>

聯(lián)絡(luò)方式:

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

国产精品成人免费观看视频-五月婷婷在线观看视频-精品人妻中文字幕一区二区-久久99一区二区三区 国产成人精品亚洲日本在线观看-99热在线免费精品-久久久熟妇xxxx网站-精品国产免费久久久久久婷婷 | 精品人妻少妇久久久久久久久-亚洲成人国产精品网站-中文字幕免费高清成人-欧美日韩久久在线观看 精品国产18久久久久久二百-午夜鲁丝一区二区鲁丝久久久-91午夜精品一区二区在线观看-蜜臀久久99精品久久宅男 | 亚洲一区二区三区熟女少妇-人人搞人人射人人插-激情综合婷婷六月天-日韩中文久久久人妻 | 亚洲区自拍三级图片-国产成人精品日韩欧美在线-色婷婷色综合网站-五月婷婷啪啪俺去啦 | 国产成人久久一区二区三区-视频一区 视频二区视频三区-最近最好看的中文字幕8-国产精品久久久久久久果冻 | 91精品国产刺激国语对白长长-精品亚洲999久久久久-久久九九热在线播放-中文字幕在线日韩成人 | 九九久久亚洲av东方伊甸园-国产av一二三四区-91成人 在线观看喷潮红桃-天天日天天射天天干天天舔 | 久久久久成人亚洲综合精品-999在线视频精品免费播放观看-欧美日韩一级久久道-国产麻豆精品视频免费观看 | 国产精品久久久久免费-亚洲综合天堂av网站在线观看-成人h动漫精品一区二区樱花-国产欧美一区二区三区四区 | 久久人妻精品大奶一区二区-国模私拍大尺度视频-精品久久久久久18禁免费-日本va欧美va欧美精品88 超碰天天操天天操天天操天天-色婷婷成人综合激情免费视频-久久精品国产自在现线免费-亚洲精品乱码久久久9999 | 国产999精品在线-男同gay片av网站腐女天堂-亚洲精品人妻在线视频观看-精品中文字幕久久久久久 | 国产勾引一级日韩欧美一级日韩欧美-白浆内射一区二区三区四区-99精品国产在热2019-国产69精品久久久久久久乱码 | 中文字幕乱码一区久-欧美日韩一区二区三区四区在线-69精品一区二区三区在线-av天堂中文在线资源库 | 日韩av日韩黄片-中文字幕av不卡一区二区三区-91精品综合久久久久久-久久久久北条麻妃性色av | 丰满少妇人妻一区二区三区-国产精品久久久久久亚洲秋霞-99久999这里只有精品-久久久熟妇熟女ⅹxxx国产 | 欧美综合色一区二区-91大神探花视频在线观看-中文字幕久久高清-蜜臀99久久精品久久久久 | 欧美精品婷婷久久久久久-日韩美女一级免费视频-成人av电影一区在线-婷婷射在线视频 | 18禁国产91精品久久久久久-成人国产激情在线视频-91色婷婷在线视频免费观看-国产 日韩 欧美 精品 | 国产精品久久久久久精品国产-精品乱子伦一区两区三区-日韩av观看网-久一视频在线播放免费 | 丰满熟女一区二区三区三州-五月激情中文字幕-五月婷婷在线看-av麻豆国产在线观看 | 日本熟女五十路在线-蜜桃久久久亚洲精品网-xart官网一区二区三区-九九99九九精彩3 | 91一区二区三区4区-亚洲天堂a中文字幕-成人 精品 蜜桃 视频-狠狠夜色午夜久久综合热久久久久久 | 激情婷婷在线观看视频-2023男人天堂网-97日韩人妻颜射精品-久久伊人视频在线 | 久久久久亚洲国产精品-亚洲中文字幕精品免费-亚洲天堂自拍偷拍网-久久精品国产av熟女 | 97精品人妻一区二区三区大全-国产又粗又猛又爽黄老大爷视频-69精品人妻一区二区三区香蕉-人妻 日韩 中文字幕 一区 | 99蜜桃久久久久久-国产亚洲精品视频2-亚洲国产日韩手机专区第一页-日韩久久久久久中文字幕 | 精品国产99国产精品-日本一区二区三区精品免费-国产精品av久久久久久粉嫩-丰满少妇一区二区三区四区观看 | 久久热在线中文字幕-91久久大香伊蕉在人线国产-蜜臀精品91内射久久-2021天天日天天干天天爽 | 一区二区三区在线看-国产激情自拍丝袜熟女-日韩美女在线免费视频-色吊丝av中文字幕 | 欧美精品久久99久-国产久精品9999-国产人妻人伦精品免费-人妻少妇久久久久久人妻 | 国产三级视频一区二区在线观看-成人av欧美在线网站-91久久精品人妻一区二区-国产伦精一品二品三品 | 国产精品久久久久高潮-99久久99久久免费精品蜜桃-久久激情中文字幕-日韩av新片在线观看 | 激情中文字幕国产在线视频-久久久久久久久老妇人精品-777午夜精品久久av-年轻的母亲中文字幕1 | 国产三级日韩三级欧美三级-东京热av精品人妻一区二区三区-午夜老司机视频免费-蜜臀av不卡综合 | 操老女人老91妇女老熟女-日韩性生活视频-亚洲午夜激情视频在线观看-日韩伊人网在线播放 | 国产69精品久久久999-久久在线观看伊人观看伊人网-欧美日韩制服丝袜变态另类-中文字幕日韩欧美人妻乱淫影片 | 日韩夫妻性生活大片-免费人成黄页在线观看国产-亚洲日本久久久久婷婷-久久99国产蜜臀精品 | 国产日韩一区二区三区视频-国产一区二区中文乱码-欧美久久久精品久久久精品-亚洲成人午夜精品av 97人妻精品一区二区三区-一区二区三四区免费观看熟女视频-蜜乳av一区二区三-日韩精品卡通动漫网站 | av一区二区精品久久-日韩欧美伦理片在线播放-国产精品99久久久久久久久久久-久成人免费精品xxx | 麻豆波多野中文字幕-91精品国产色综合久久ai换脸-97精品人妻一区二区三区四区-老色鬼久久亚洲av综合0男男 | 人人妻人人躁人人爽-国产91精品久久久久久久-91麻豆精品在线观看视频-五月婷婷网在线观看 |