mirror of
https://github.com/lsky-org/lsky-pro.git
synced 2025-01-08 11:57:52 +08:00
🔧 去除 mysqli 安装条件, 换成 PDO
This commit is contained in:
parent
629078637b
commit
338ef83f73
@ -42,7 +42,7 @@
|
||||
### 🛠 安装要求
|
||||
* PHP 版本 ≥ 5.6(≤ 7.3)
|
||||
* mysql 版本 ≥ 5.5
|
||||
* mysqli 支持
|
||||
* PDO 拓展
|
||||
* ZipArchive 支持
|
||||
* fileinfo 拓展
|
||||
* curl 拓展
|
||||
|
@ -18,14 +18,14 @@ class Initialize
|
||||
if ($request->controller(true) !== 'install' || $request->action(true) !== 'index') {
|
||||
return redirect(url('install/index'));
|
||||
}
|
||||
}
|
||||
|
||||
// 检测封禁IP
|
||||
$banIp = $this->getConfig('ban_ip');
|
||||
if ($banIp) {
|
||||
$ips = explode(',', str_replace(',', ',', $banIp));
|
||||
if (in_array($request->ip(), $ips)) {
|
||||
throw new HttpResponseException(Response::code(403));
|
||||
} else {
|
||||
// 检测封禁IP
|
||||
$banIp = $this->getConfig('ban_ip');
|
||||
if ($banIp) {
|
||||
$ips = explode(',', str_replace(',', ',', $banIp));
|
||||
if (in_array($request->ip(), $ips)) {
|
||||
throw new HttpResponseException(Response::code(403));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,9 @@ class WebAuthenticate
|
||||
|
||||
$user = null;
|
||||
if ($uid = Session::get('uid')) {
|
||||
$user = Users::get($uid);
|
||||
if (!$user = Users::get($uid)) {
|
||||
Session::delete('uid');
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($path, $this->paths) && !$user) {
|
||||
|
@ -25,18 +25,18 @@ class Install extends Controller
|
||||
$phpVerGt56 = PHP_VERSION >= 5.6;
|
||||
$isCurl = function_exists('curl_init');
|
||||
$isFileInfo = function_exists('finfo_open');
|
||||
$isMysqli = class_exists('mysqli');
|
||||
$pdo = extension_loaded("pdo_mysql");
|
||||
$isZip = class_exists('ZipArchive');
|
||||
|
||||
switch ($step) {
|
||||
case 1:
|
||||
// 运行环境检测
|
||||
$testing = $phpVerGt56 && $isCurl && $isFileInfo && $isMysqli && $isZip;
|
||||
$testing = $phpVerGt56 && $isCurl && $isFileInfo && $pdo && $isZip;
|
||||
$this->assign([
|
||||
'phpVerGt56' => $phpVerGt56,
|
||||
'isCurl' => $isCurl,
|
||||
'isFileInfo' => $isFileInfo,
|
||||
'isMysqli' => $isMysqli,
|
||||
'pdo' => $pdo,
|
||||
'isZip' => $isZip,
|
||||
'testing' => $testing,
|
||||
'dir' => is_writable(app()->getRuntimePath()) && is_writable(app()->getConfigPath()),
|
||||
|
@ -76,10 +76,10 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
mysqli:
|
||||
PDO 拓展:
|
||||
</td>
|
||||
<td align="left">
|
||||
{if ($isMysqli) }
|
||||
{if ($pdo) }
|
||||
<i class="mdui-icon material-icons mdui-text-color-green"></i>
|
||||
{else/}
|
||||
<i class="mdui-icon material-icons mdui-text-color-red"></i>
|
||||
|
Loading…
Reference in New Issue
Block a user