重构安装方式

This commit is contained in:
WispX
2020-03-14 23:13:03 +08:00
parent c36831ccea
commit 4d28c60cb8
14 changed files with 166 additions and 188 deletions
+9 -16
View File
@@ -9,29 +9,29 @@
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
$database = [
return [
// 数据库类型
'type' => 'mysql',
// 数据库连接DSN配置
'dsn' => '',
// 服务器地址
'hostname' => '127.0.0.1',
'hostname' => env('database.hostname', '127.0.0.1'),
// 数据库名
'database' => '',
'database' => env('database.database', 'lsky'),
// 数据库用户名
'username' => 'root',
'username' => env('database.username', 'root'),
// 数据库密码
'password' => '',
'password' => env('database.password', ''),
// 数据库连接端口
'hostport' => '',
'hostport' => env('database.hostport', '3306'),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => 'utf8mb4',
'charset' => env('database.charset', 'utf8mb4'),
// 数据库表前缀
'prefix' => 'lsky_',
'prefix' => env('database.prefix'),
// 数据库调试模式
'debug' => true,
'debug' => false,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
@@ -61,10 +61,3 @@ $database = [
// 断线标识字符串
'break_match_str' => [],
];
$pathname = Env::get('config_path') . 'db.php';
if (file_exists($pathname)) {
return array_merge($database, require $pathname);
} else {
return $database;
}