Commit b5de1873 authored by Crell's avatar Crell
Browse files

Let getDriverClass() handle defaults, so that extenders work. Also use it in...

Let getDriverClass() handle defaults, so that extenders work. Also use it in more places, eliminating the old-school crappy approach.
parent 8f07a990
...@@ -589,7 +589,8 @@ protected function expandArguments(&$query, &$args) { ...@@ -589,7 +589,8 @@ protected function expandArguments(&$query, &$args) {
public function getDriverClass($class) { public function getDriverClass($class) {
if (empty($this->driverClasses[$class])) { if (empty($this->driverClasses[$class])) {
$driver = $this->driver(); $driver = $this->driver();
$this->driverClasses[$class] = "Drupal\\Database\\Driver\\{$driver}\\{$class}"; $driver_class = "Drupal\\Database\\Driver\\{$driver}\\{$class}";
$this->driverClasses[$class] = class_exists($driver_class) ? $driver_class : $class;
} }
return $this->driverClasses[$class]; return $this->driverClasses[$class];
} }
......
...@@ -1010,6 +1010,6 @@ function db_run_tasks($driver) { ...@@ -1010,6 +1010,6 @@ function db_run_tasks($driver) {
* The name of the driver. * The name of the driver.
*/ */
function db_installer_object($driver) { function db_installer_object($driver) {
$task_class = "Drupal\\Database\\Driver\\{$driver}\\Install\\Tasks"; $class = Database::getConnection()->getDriverClass('Install\\Tasks');
return new $task_class(); return new $class();
} }
...@@ -182,7 +182,7 @@ function system_requirements($phase) { ...@@ -182,7 +182,7 @@ function system_requirements($phase) {
} }
else { else {
// Database information. // Database information.
$class = 'DatabaseTasks_' . Database::getConnection()->driver(); $class = Database::getConnection()->getDriverClass('Install\\Tasks');
$tasks = new $class(); $tasks = new $class();
$requirements['database_system'] = array( $requirements['database_system'] = array(
'title' => $t('Database system'), 'title' => $t('Database system'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment