From 3a58e928b6c1be6da5e791e0f6c0a0e2b6164ee6 Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Fri, 21 Feb 2020 08:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/command/InstallCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extend/catcher/command/InstallCommand.php b/extend/catcher/command/InstallCommand.php index 6d7e473..d6bfdca 100644 --- a/extend/catcher/command/InstallCommand.php +++ b/extend/catcher/command/InstallCommand.php @@ -129,11 +129,17 @@ class InstallCommand extends Command $prefix = $this->output->ask($this->input, '👉 please input table prefix, default (null):') ? : ''; $username = $this->output->ask($this->input, '👉 please input database username default (root): ') ? : 'root'; $password = ''; + $tryTimes = 0; while (!$password) { $password = $this->output->ask($this->input, '👉 please input database password: '); if ($password) { break; } + // 尝试三次以上未填写,视为密码空 + $tryTimes++; + if (!$password && $tryTimes > 2) { + break; + } } $this->databaseLink = [$host, $database, $username, $password, $port, $charset, $prefix];