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

PHP 源代碼壓縮小工具

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

下載: compactor.php
復制代碼 代碼如下:
#!/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技術PHP 源代碼壓縮小工具,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 常宁市| 白山市| 余干县| 罗平县| 西乌珠穆沁旗| 潍坊市| 韩城市| 大理市| 腾冲县| 淮南市| 余干县| 兴国县| 麦盖提县| 塘沽区| 安达市| 栾川县| 南华县| 卫辉市| 金沙县| 疏附县| 富裕县| 武乡县| 溧水县| 凤台县| 抚松县| 铜川市| 美姑县| 高青县| 永善县| 文成县| 新沂市| 轮台县| 微山县| 长岭县| 洪湖市| 涿鹿县| 石楼县| 岑溪市| 香格里拉县| 大足县| 黔南|