优化install

This commit is contained in:
吴彦文 2020-04-08 17:44:35 +08:00
parent 8d10baa35f
commit 56f6ba90a6

View File

@ -160,25 +160,26 @@ class InstallProjectCommand extends Command
if (!$this->databaseLink) { if (!$this->databaseLink) {
unlink($this->getEnvFilePath()); unlink($this->getEnvFilePath());
$this->execute($this->input, $this->output); $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();
} }
} }