mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 23:37:31 +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
4590b2cd30
commit
65535bf738
|
@ -35,10 +35,18 @@ class UserDataProvider implements DataProviderInterface
|
||||||
|
|
||||||
public function getDatabaseConfiguration()
|
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 [
|
return [
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'host' => $this->ask('Database host:'),
|
'host' => $host,
|
||||||
'port' => $this->ask('Database port:'),
|
'port' => $port,
|
||||||
'database' => $this->ask('Database name:'),
|
'database' => $this->ask('Database name:'),
|
||||||
'username' => $this->ask('Database user:'),
|
'username' => $this->ask('Database user:'),
|
||||||
'password' => $this->secret('Database password:'),
|
'password' => $this->secret('Database password:'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user