✨ 更新时不覆盖环境变量文件
This commit is contained in:
@@ -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('安装锁文件创建失败');
|
||||
|
||||
Reference in New Issue
Block a user