优化安装程序
This commit is contained in:
@@ -8,8 +8,6 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
namespace think;
|
namespace think;
|
||||||
|
|
||||||
use think\facade\Db;
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
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());
|
define('ROOT_PATH', $app->getRootPath());
|
||||||
$status = [
|
|
||||||
'index' => 'info',
|
|
||||||
'check' => 'info',
|
|
||||||
'config' => 'info',
|
|
||||||
'sql' => 'info',
|
|
||||||
'complete' => 'info',
|
|
||||||
];
|
|
||||||
|
|
||||||
$action = $app->request->param('action', 'index');
|
$action = $app->request->param('action', 'index');
|
||||||
|
|
||||||
$title = "";
|
$title = "";
|
||||||
@@ -119,7 +109,6 @@ if ($action == 'index') {
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function showmsg(msg, classname){
|
function showmsg(msg, classname){
|
||||||
$('div#show-list').append('<li class="list-group-item text-'+classname+'">'+msg+'</li>');
|
$('div#show-list').append('<li class="list-group-item text-'+classname+'">'+msg+'</li>');
|
||||||
document.scrollTop += 30;
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@@ -627,7 +616,7 @@ function register_administrator($db, $prefix, $admin){
|
|||||||
*/
|
*/
|
||||||
function update_tables($db, $prefix = ''){
|
function update_tables($db, $prefix = ''){
|
||||||
//读取SQL文件
|
//读取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 = str_replace("\r", "\n", $sql);
|
||||||
$sql = explode(";\n", $sql);
|
$sql = explode(";\n", $sql);
|
||||||
|
|
||||||
@@ -679,17 +668,6 @@ function show_msg($msg, $class = 'primary'){
|
|||||||
ob_flush();
|
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){
|
function session($name, $value = false){
|
||||||
if ($name == '') {
|
if ($name == '') {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user