Skip to content

Commit

Permalink
优化打包程序
Browse files Browse the repository at this point in the history
  • Loading branch information
bg5sbk committed Jul 19, 2021
1 parent 563cb6a commit 104db25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions build.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'build.php',
'install.php',
'install_template.txt',
'mc-debug'
);

$files = '';
Expand All @@ -27,7 +28,7 @@
file_put_contents("install.php", $template);

function build($dirs, &$files) {
global $ignores;
global $ignores;

foreach ($dirs as $dir) {
if (!is_dir($dir)) {
Expand All @@ -37,17 +38,18 @@ function build($dirs, &$files) {

if ($dh = opendir($dir)) {
$sub_dirs = array();

while (($item = readdir($dh)) !== false) {
if ($item[0] == '.')
continue;

if ($dir == '.')
$file = $item;
else
$file = $dir."/".$item;
if ($dir == '.')
$file = $item;
else
$file = $dir."/".$item;

if (in_array($file, $ignores))
continue;
if (in_array($file, $ignores))
continue;

if (is_dir($file)) {
$sub_dirs[] = $file;
Expand All @@ -57,6 +59,7 @@ function build($dirs, &$files) {
$files .= "');\n";
}
}

closedir($dh);
build($sub_dirs, $files);
} else {
Expand Down
2 changes: 1 addition & 1 deletion install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ window.onload = window.onresize = function(){
<body style="background:#f2f2f2;">
<div id="main">
<div style="font-size:32px;font-weight:bold;text-align:center;padding-top:40px;">MiniCMS安装程序</div>
<div style="font-size:13px;color:#888;text-align:center;padding:10px 0 20px;">v1.9</div>
<div style="font-size:13px;color:#888;text-align:center;padding:10px 0 20px;">v/*MINICMS_VERSION*/</div>
<div id="mainbox">
<?php if (!isset($_POST["start_install"])) { ?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Expand Down

0 comments on commit 104db25

Please sign in to comment.