Backup the .env during update
This commit is contained in:
parent
5ee474035a
commit
7e28e0f77e
1 changed files with 3 additions and 1 deletions
|
|
@ -191,7 +191,9 @@ class AppController extends BaseController
|
|||
$config .= "{$key}={$val}\n";
|
||||
}
|
||||
|
||||
$fp = fopen(base_path().'/.env', 'w');
|
||||
$filePath = base_path().'/.env';
|
||||
copy($filePath, $filePath . '.backup.' . time());
|
||||
$fp = fopen($filePath, 'w');
|
||||
fwrite($fp, $config);
|
||||
fclose($fp);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue