修改install

This commit is contained in:
wuyanwen 2020-02-21 08:09:33 +08:00
parent b998d58dea
commit 3a58e928b6

View File

@ -129,11 +129,17 @@ class InstallCommand extends Command
$prefix = $this->output->ask($this->input, '👉 please input table prefix, default (null):') ? : ''; $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'; $username = $this->output->ask($this->input, '👉 please input database username default (root): ') ? : 'root';
$password = ''; $password = '';
$tryTimes = 0;
while (!$password) { while (!$password) {
$password = $this->output->ask($this->input, '👉 please input database password: '); $password = $this->output->ask($this->input, '👉 please input database password: ');
if ($password) { if ($password) {
break; break;
} }
// 尝试三次以上未填写,视为密码空
$tryTimes++;
if (!$password && $tryTimes > 2) {
break;
}
} }
$this->databaseLink = [$host, $database, $username, $password, $port, $charset, $prefix]; $this->databaseLink = [$host, $database, $username, $password, $port, $charset, $prefix];