优化安装程序

This commit is contained in:
2020-04-14 14:59:46 +08:00
parent 6b9298df5d
commit 30cb23b68b

View File

@@ -8,8 +8,6 @@
// +----------------------------------------------------------------------
namespace think;
use think\facade\Db;
session_start();
require __DIR__ . '/../vendor/autoload.php';
@@ -20,14 +18,6 @@ if (is_file($app->getRootPath() . '.env') && is_file($app->getRootPath() . 'inst
}
define('ROOT_PATH', $app->getRootPath());
$status = [
'index' => 'info',
'check' => 'info',
'config' => 'info',
'sql' => 'info',
'complete' => 'info',
];
$action = $app->request->param('action', 'index');
$title = "";
@@ -119,7 +109,6 @@ if ($action == 'index') {
<script type="text/javascript">
function showmsg(msg, classname){
$('div#show-list').append('<li class="list-group-item text-'+classname+'">'+msg+'</li>');
document.scrollTop += 30;
}
</script>
</head>
@@ -627,7 +616,7 @@ function register_administrator($db, $prefix, $admin){
*/
function update_tables($db, $prefix = ''){
//读取SQL文件
$sql = file_get_contents(ROOT_PATH . 'data/update.sql');
$sql = file_get_contents(ROOT_PATH . 'runtime' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'update.sql');
$sql = str_replace("\r", "\n", $sql);
$sql = explode(";\n", $sql);
@@ -679,17 +668,6 @@ function show_msg($msg, $class = 'primary'){
ob_flush();
}
/**
* 生成系统AUTH_KEY
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
function build_auth_key(){
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$chars .= '`~!@#$%^&*()_+-=[]{};:"|,.<>/?';
$chars = str_shuffle($chars);
return substr($chars, 0, 40);
}
function session($name, $value = false){
if ($name == '') {
return false;