From 56f6ba90a69aa893a975ed8802f503e8f0ae3ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=BD=A6=E6=96=87?= Date: Wed, 8 Apr 2020 17:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/install/InstallProjectCommand.php | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/extend/catcher/command/install/InstallProjectCommand.php b/extend/catcher/command/install/InstallProjectCommand.php index c5bbc23..d52ad7a 100644 --- a/extend/catcher/command/install/InstallProjectCommand.php +++ b/extend/catcher/command/install/InstallProjectCommand.php @@ -160,25 +160,26 @@ class InstallProjectCommand extends Command if (!$this->databaseLink) { unlink($this->getEnvFilePath()); $this->execute($this->input, $this->output); + } else { + + [ + $connections['mysql']['hostname'], + $connections['mysql']['database'], + $connections['mysql']['username'], + $connections['mysql']['password'], + $connections['mysql']['hostport'], + $connections['mysql']['charset'], + $connections['mysql']['prefix'], + ] = $this->databaseLink ?: [ + env('mysql.hostname') + ]; + + \config([ + 'connections' => $connections, + ], 'database'); + + $this->migrateAndSeeds(); } - - [ - $connections['mysql']['hostname'], - $connections['mysql']['database'], - $connections['mysql']['username'], - $connections['mysql']['password'], - $connections['mysql']['hostport'], - $connections['mysql']['charset'], - $connections['mysql']['prefix'], - ] = $this->databaseLink ? : [ - env('mysql.hostname') - ]; - - \config([ - 'connections' => $connections, - ], 'database'); - - $this->migrateAndSeeds(); } }