diff --git a/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php old mode 100644 new mode 100755 index d13ea80..40c5197 --- a/core/lib/Drupal/Core/Database/Database.php +++ b/core/lib/Drupal/Core/Database/Database.php @@ -365,6 +365,8 @@ throw new DriverNotSpecifiedException('Driver not specified for this database connection: ' . $key); } + // @todo https://www.drupal.org/project/drupal/issues/3115388 + // Remove use of the deprecated getDatabaseDriverNamespace in Drupal 9.1.0. $namespace = static::getDatabaseDriverNamespace(self::$databaseInfo[$key][$target]); $driver_class = $namespace . '\\Connection'; @@ -488,6 +490,8 @@ public static function getConnectionInfoAsUrl($key = 'default') { if (empty($db_info) || empty($db_info['default'])) { throw new \RuntimeException("Database connection $key not defined or missing the 'default' settings"); } + // @todo https://www.drupal.org/project/drupal/issues/3115388 + // Remove use of the deprecated getDatabaseDriverNamespace in Drupal 9.1.0. $connection_class = static::getDatabaseDriverNamespace($db_info['default']) . '\\Connection'; return $connection_class::createUrlFromConnectionOptions($db_info['default']); } @@ -502,8 +506,13 @@ public static function getConnectionInfoAsUrl($key = 'default') { * * @return string * The PHP namespace of the driver's database. + * + * @deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. + * $info['namespace] is always set now. + * @see https://www.drupal.org/project/drupal/issues/3112476. */ protected static function getDatabaseDriverNamespace(array $connection_info) { + @trigger_error("getDatabaseDriverNamespace() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. $info['namespace'] is always set now. See https://www.drupal.org/project/drupal/issues/3115388.", E_USER_DEPRECATED); if (isset($connection_info['namespace'])) { return $connection_info['namespace']; }