色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

PHP 源代碼壓縮小工具

使用方法:(在命令行運(yùn)行)
復(fù)制代碼 代碼如下:
php compactor.php DESTINATION.php SOURCE.php

下載: compactor.php
復(fù)制代碼 代碼如下:
#!/usr/bin/env php
<?php
/**
* Compact php code.
*
* Strip comments, combine entire library into one file.
*/

if ($argc < 3) {
print "Strip unecessary data from php source files./n/n/tUsage: php compactor.php DESTINATION.php SOURCE.php";
exit;
}


$source = $argv[2];
$target = $argv[1];
print "Compacting $source into $target./n";

include $source;

$files = get_included_files();
print_r($files);

$out = fopen($target, 'w');
fwrite($out, '<?php' . php_EOL);
fwrite($out, '// QueryPath. Copyright (c) 2009, Matt Butcher.' . php_EOL);
fwrite($out, '// This software is released under the LGPL, v. 2.1 or an MIT-style license.' . php_EOL);
fwrite($out ,'// http://opensource.org/licenses/lgpl-2.1.php');
fwrite($out, '// http://querypath.org.' . php_EOL);
foreach ($files as $f) {
if ($f !== __FILE__) {
$contents = file_get_contents($f);
foreach (token_get_all($contents) as $token) {
if (is_string($token)) {
fwrite($out, $token);
}
else {
switch ($token[0]) {
case T_REQUIRE:
case T_REQUIRE_ONCE:
case T_INCLUDE_ONCE:
// We leave T_INCLUDE since it is rarely used to include
// libraries and often used to include HTML/template files.
case T_COMMENT:
case T_DOC_COMMENT:
case T_OPEN_TAG:
case T_CLOSE_TAG:
break;
case T_WHITESPACE:
fwrite($out, ' ');
break;
default:
fwrite($out, $token[1]);
}

}
}
}
}
fclose($out);
?>

php技術(shù)PHP 源代碼壓縮小工具,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 靖江市| 甘德县| 五原县| 三亚市| 中山市| 达拉特旗| 吉木萨尔县| 江门市| 景德镇市| 定远县| 金乡县| 怀来县| 桑植县| 莎车县| 锡林郭勒盟| 宁南县| 河南省| 泽州县| 井冈山市| 姚安县| 朝阳区| 土默特右旗| 延津县| 白城市| 呼伦贝尔市| 甘谷县| 柞水县| 永德县| 绍兴市| 保山市| 柳林县| 白玉县| 顺平县| 纳雍县| 天水市| 南岸区| 翁源县| 武城县| 武平县| 万载县| 长乐市|