From 2ee2c30306f4cab7c9661006e8dc6697a90073ea Mon Sep 17 00:00:00 2001 From: LyLme Date: Sat, 23 Dec 2023 00:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20v1.8.0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/index.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/install/index.php b/install/index.php index 6e3145d..8007cf9 100644 --- a/install/index.php +++ b/install/index.php @@ -42,9 +42,9 @@ $GLOBALS['isNext'] = true; // 获取当前步骤 function getStep() { - $s1 = $_GET['s'] ?? 0; + $s1 = $_GET['s'] ?: 0; // 初始化参数 - $s2 = $_POST['s'] ?? 0; + $s2 = $_POST['s'] ?: 0; // 如果有GET值则覆盖POST值 if ($s1 > 0 && in_array($s1, [1, 63832, md5('done')])) { $s2 = $s1; @@ -81,13 +81,13 @@ if ($s == 3) { if ($_POST['s'] == 3) { // 初始化信息 - $dbhost = $_POST['dbhost'] ?? ''; - $dbname = $_POST['dbname'] ?? ''; - $dbuser = $_POST['dbuser'] ?? ''; - $dbpwd = $_POST['dbpwd'] ?? ''; - $dbport = $_POST['dbport'] ?? 3306; + $dbhost = $_POST['dbhost'] ?: ''; + $dbname = $_POST['dbname'] ?: ''; + $dbuser = $_POST['dbuser'] ?: ''; + $dbpwd = $_POST['dbpwd'] ?: ''; + $dbport = $_POST['dbport'] ?: 3306; - $testdata = $_POST['testdata'] ?? ''; + $testdata = $_POST['testdata'] ?: ''; // 连接证数据库 try { @@ -188,10 +188,10 @@ if ($s == 3) { // 检测数据库信息 if ($s == 63832) { - $dbhost = $_GET['dbhost'] ?? ''; - $dbuser = $_GET['dbuser'] ?? ''; - $dbpwd = $_GET['dbpwd'] ?? ''; - $dbport = $_GET['dbport'] ?? ''; + $dbhost = $_GET['dbhost'] ?: ''; + $dbuser = $_GET['dbuser'] ?: ''; + $dbpwd = $_GET['dbpwd'] ?: ''; + $dbport = $_GET['dbport'] ?: ''; try { $dsn = "mysql:host=$dbhost;port={$dbport};charset=utf8"; $pdo = new PDO($dsn, $dbuser, $dbpwd); @@ -316,7 +316,7 @@ function setIsNext(bool $bool) } // 获取data文件夹中的文件内容 -function readDataFile(string $file) +function readDataFile($file) { return file_get_contents(INSTALL_PATH . '/data/' . $file); }