更新时不覆盖环境变量文件

This commit is contained in:
WispX
2020-03-18 09:22:33 +08:00
parent 47d6a60f4c
commit 00c2f3a979
@@ -119,25 +119,6 @@ class System extends Base
$isBackup && $upgrade->backup($backup); // 备份原系统
// 复制 env 文件
$config = \config('database.');
$env = str_ireplace([
'{hostname}',
'{database}',
'{username}',
'{password}',
'{hostport}',
], [
$config['hostname'],
$config['database'],
$config['username'],
$config['password'],
$config['hostport'],
], @file_get_contents($path . '.env.example'));
if (!@file_put_contents($path . '.env', $env)) {
throw new \Exception('配置文件写入失败');
}
// 创建安装锁文件
if (!@fopen($path . 'application/install.lock', 'w')) {
throw new \Exception('安装锁文件创建失败');