From 32a56fef4f22a7c3367a88e032bcb248b920e9f5 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Thu, 21 Apr 2022 12:01:05 +0100 Subject: [PATCH] Issue #2236983 by quietone, DenEwout: Not at all clear how/when Database::addConnectionInfo should be called (cherry picked from commit 3c075db557ee5e96272607839e78debe96680c15) --- core/lib/Drupal/Core/Database/Database.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php index 96af8c5741d9..6439c17dbafe 100644 --- a/core/lib/Drupal/Core/Database/Database.php +++ b/core/lib/Drupal/Core/Database/Database.php @@ -272,7 +272,9 @@ final public static function parseConnectionInfo(array $info) { * Under normal circumstances the preferred way to specify database * credentials is via settings.php. However, this method allows them to be * added at arbitrary times, such as during unit tests, when connecting to - * admin-defined third party databases, etc. + * admin-defined third party databases, etc. Use + * \Drupal\Core\Database\Database::setActiveConnection to select the + * connection to use. * * If the given key/target pair already exists, this method will be ignored. * @@ -284,6 +286,8 @@ final public static function parseConnectionInfo(array $info) { * The database connection information, as defined in settings.php. The * structure of this array depends on the database driver it is connecting * to. + * + * @see \Drupal\Core\Database\Database::setActiveConnection */ final public static function addConnectionInfo($key, $target, array $info) { if (empty(self::$databaseInfo[$key][$target])) { -- GitLab