From ae799c57c0d2477235644b092bb38fd2e37fd292 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 11 Feb 2022 10:02:33 +0700 Subject: [PATCH 1/2] [ticket/16965] Allow empty value as default database server name on installing PHPBB3-16965 --- phpBB/phpbb/db/doctrine/connection_parameter_factory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/phpbb/db/doctrine/connection_parameter_factory.php b/phpBB/phpbb/db/doctrine/connection_parameter_factory.php index bf0a18f5e8..4649bbde84 100644 --- a/phpBB/phpbb/db/doctrine/connection_parameter_factory.php +++ b/phpBB/phpbb/db/doctrine/connection_parameter_factory.php @@ -37,7 +37,7 @@ class connection_parameter_factory */ public static function get_configuration( string $driver, - string $host, + ?string $host = null, ?string $user = null, ?string $password = null, ?string $name = null, @@ -73,7 +73,7 @@ class connection_parameter_factory */ private static function build_connection_parameters( array $params, - string $host, + ?string $host = null, ?string $user = null, ?string $password = null, ?string $name = null, @@ -86,7 +86,7 @@ class connection_parameter_factory ); } - if (empty($host) || empty($user) || empty($name)) + if (empty($user) || empty($name)) { throw new InvalidArgumentException('Required database parameter is not set.'); } From e7eb1cdd52955a86a504c8ab4a19ffd6bd6a8251 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 11 Feb 2022 12:54:28 +0700 Subject: [PATCH 2/2] [ticket/16965] Adjust docblocks PHPBB3-16965 --- phpBB/phpbb/db/doctrine/connection_parameter_factory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/db/doctrine/connection_parameter_factory.php b/phpBB/phpbb/db/doctrine/connection_parameter_factory.php index 4649bbde84..4899f916f4 100644 --- a/phpBB/phpbb/db/doctrine/connection_parameter_factory.php +++ b/phpBB/phpbb/db/doctrine/connection_parameter_factory.php @@ -25,7 +25,7 @@ class connection_parameter_factory * Returns configuration options for Doctrine DBAL. * * @param string $driver Driver name. - * @param string $host Hostname. + * @param string|null $host Hostname. * @param string|null $user Username. * @param string|null $password Password. * @param string|null $name Database name. @@ -61,7 +61,7 @@ class connection_parameter_factory * Build Doctrine configuration array. * * @param array $params Parameter array. - * @param string $host Database hostname. + * @param string|null $host Database hostname. * @param string|null $user Username. * @param string|null $password Password. * @param string|null $name Database name.