Try to extract port from host when installing in console

The very last suggestion broght up in pull request #989.
This commit is contained in:
Franz Liedke 2017-02-03 18:15:52 +01:00
parent da6f79b34a
commit bccc970231
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -35,10 +35,18 @@ class UserDataProvider implements DataProviderInterface
public function getDatabaseConfiguration()
{
$host = $this->ask('Database host:');
if (str_contains($host, ':')) {
list($host, $port) = explode(':', $host, 2);
} else {
$port = $this->ask('Database port:');
}
return [
'driver' => 'mysql',
'host' => $this->ask('Database host:'),
'port' => $this->ask('Database port:'),
'host' => $host,
'port' => $port,
'database' => $this->ask('Database name:'),
'username' => $this->ask('Database user:'),
'password' => $this->secret('Database password:'),