mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
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:
parent
da6f79b34a
commit
bccc970231
|
@ -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:'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user