diff -u b/core/includes/install.core.inc b/core/includes/install.core.inc --- b/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -991,9 +991,6 @@ ':input[name=driver]' => array('value' => $key), ) ); - if (!$driver->isCore()) { - $form['settings'][$key]['db_driver'] = array('#type' => 'value', '#value' => $key); - } } $form['actions'] = array('#type' => 'actions'); @@ -1021,6 +1018,10 @@ function install_settings_form_validate($form, &$form_state) { $driver = $form_state['values']['driver']; $database = $form_state['values'][$driver]; + $drivers = drupal_get_database_types(); + if ($drivers[$driver]->isCustom()) { + $database['custom'] = TRUE; + } $database['driver'] = $driver; // TODO: remove when PIFR will be updated to use 'db_prefix' instead of diff -u b/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php --- b/core/lib/Drupal/Core/Database/Connection.php +++ b/core/lib/Drupal/Core/Database/Connection.php @@ -619,12 +619,11 @@ */ public function getDriverClass($class) { if (empty($this->driverClasses[$class])) { - if (isset($this->connectionOptions['db_driver'])) { - $driver = $this->connectionOptions['db_driver']; + $driver = $this->driver(); + if (!empty($this->connectionOptions['custom'])) { $driver_class = "Drupal\\{$driver}\\{$class}"; } else { - $driver = $this->driver(); $driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\{$class}"; } $this->driverClasses[$class] = class_exists($driver_class) ? $driver_class : $class; diff -u b/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php --- b/core/lib/Drupal/Core/Database/Database.php +++ b/core/lib/Drupal/Core/Database/Database.php @@ -369,19 +369,17 @@ if (!isset(self::$databaseInfo[$key])) { throw new ConnectionNotDefinedException('The specified database connection is not defined: ' . $key); } - if (!$driver = self::$databaseInfo[$key][$target]['driver']) { throw new DriverNotSpecifiedException('Driver not specified for this database connection: ' . $key); } - if (isset(self::$databaseInfo[$key][$target]['db_driver'])) { - $driver = self::$databaseInfo[$key][$target]['db_driver']; + + if (!empty(self::$databaseInfo[$key][$target]['custom'])) { drupal_classloader_register($driver, "db_drivers/$driver"); - $driver_namespace = 'Drupal'; + $driver_class = "Drupal\\{$driver}\\Connection"; } else { - $driver_namespace = 'Drupal\\Core\\Database\\Driver'; + $driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Connection"; } - $driver_class = "{$driver_namespace}\\{$driver}\\Connection"; $new_connection = new $driver_class(self::$databaseInfo[$key][$target]); $new_connection->setTarget($target); $new_connection->setKey($key); diff -u b/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php --- b/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -307,8 +307,8 @@ * * @return - * TRUE if this is a core driver, FALSE if the driver is in db_drivers. + * TRUE if this is a custom driver, FALSE if the driver is in core. */ - public function isCore() { - return TRUE; + public function isCustom() { + return FALSE; } }