diff --git a/application/admin/command/Install.php b/application/admin/command/Install.php index ae3da35a..f9da2cd7 100644 --- a/application/admin/command/Install.php +++ b/application/admin/command/Install.php @@ -210,7 +210,7 @@ class Install extends Command } return "'{$matches[1]}'{$matches[2]}=>{$matches[3]}Env::get('database.{$matches[1]}', '{$replace}'),"; }; - $dbConfigText = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $config); + $dbConfigText = preg_replace_callback("/'(hostname|database|username|password|hostport|prefix)'(\s+)=>(\s+)Env::get\((.*)\)\,/", $callback, $dbConfigText); // 检测能否成功写入数据库配置 $result = @file_put_contents($dbConfigFile, $dbConfigText);