diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2021-01-23 11:38:30 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2021-01-23 11:38:30 +0000 |
| commit | 354679afe0ce64cf5aad05164c7dd7eba7e37cef (patch) | |
| tree | 1d61a5b8ecb2e28dbb5af9d819ecf6e2f7771c74 /app | |
| parent | b47837c47d7b6e97a8ae8b39adde4ac935004240 (diff) | |
| download | webtrees-354679afe0ce64cf5aad05164c7dd7eba7e37cef.tar.gz webtrees-354679afe0ce64cf5aad05164c7dd7eba7e37cef.tar.bz2 webtrees-354679afe0ce64cf5aad05164c7dd7eba7e37cef.zip | |
Fix: #3684 - set default port during setup
Diffstat (limited to 'app')
| -rw-r--r-- | app/Http/RequestHandlers/SetupWizard.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/Http/RequestHandlers/SetupWizard.php b/app/Http/RequestHandlers/SetupWizard.php index af836bef14..b6ce93b090 100644 --- a/app/Http/RequestHandlers/SetupWizard.php +++ b/app/Http/RequestHandlers/SetupWizard.php @@ -82,6 +82,13 @@ class SetupWizard implements RequestHandlerInterface 'wtemail' => '', ]; + private const DEFAULT_PORTS = [ + 'mysql' => '3306', + 'pgsql' => '5432', + 'sqlite' => '', + 'sqlsvr' => '1433', + ]; + /** @var MigrationService */ private $migration_service; @@ -325,6 +332,9 @@ class SetupWizard implements RequestHandlerInterface */ private function step5Administrator(array $data): ResponseInterface { + // Use default port, if none specified. + $data['dbport'] = $data['dbport'] ?: self::DEFAULT_PORTS[$data['dbtype']]; + try { $this->connectToDatabase($data); } catch (Throwable $ex) { |
