From 20e54ed66c2c3cbf103dbf73bef67445ad2c5ceb Mon Sep 17 00:00:00 2001 From: root Date: Thu, 19 Dec 2019 22:03:01 +0800 Subject: [PATCH] update --- app/Console/Commands/V2boardInit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/V2boardInit.php b/app/Console/Commands/V2boardInit.php index cad0fccf..8da6206c 100644 --- a/app/Console/Commands/V2boardInit.php +++ b/app/Console/Commands/V2boardInit.php @@ -38,6 +38,9 @@ class V2boardInit extends Command */ public function handle() { + if (\File::get(base_path() . '/.lock')) { + abort(500, 'V2board 已安装,如需重新初始化请删除目录下.lock文件'); + } \Artisan::call('key:generate'); \Artisan::call('config:cache'); DB::connection()->getPdo(); @@ -55,6 +58,7 @@ class V2boardInit extends Command try { DB::select(DB::raw($item)); } catch (\Exception $e) {} - } + } + \File::put(base_path() . '/.lock', time()); } }