W3cubDocs

/Drupal 8

function db_installer_object

db_installer_object($driver)

Returns a database installer object.

Parameters

$driver: The name of the driver.

Return value

\Drupal\Core\Database\Install\Tasks A class defining the requirements and tasks for installing the database.

File

core/includes/install.inc, line 1092
API functions for installing modules and themes.

Code

function db_installer_object($driver) {
  // We cannot use Database::getConnection->getDriverClass() here, because
  // the connection object is not yet functional.
  $task_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Install\\Tasks";
  if (class_exists($task_class)) {
    return new $task_class();
  }
  else {
    $task_class = "Drupal\\Driver\\Database\\{$driver}\\Install\\Tasks";
    return new $task_class();
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!install.inc/function/db_installer_object/8.1.x