public static function Database::loadDriverFile

Load a file for the database that might hold a class.


$driver: The name of the driver.

array $files: The name of the files the driver specific class can be.

2 calls to Database::loadDriverFile()
DatabaseConnection::getDriverClass in drupal/includes/database/
Gets the driver-specific override class if any for the specified class.
db_installer_object in drupal/includes/
Returns a database installer object.


drupal/includes/database/, line 1818
Core systems for the database layer.


Primary front-controller for the database system.


public static function loadDriverFile($driver, array $files = array()) {
  static $base_path;
  if (empty($base_path)) {
    $base_path = dirname(realpath(__FILE__));
  $driver_base_path = "{$base_path}/{$driver}";
  foreach ($files as $file) {

    // Load the base file first so that classes extending base classes will
    // have the base class loaded.
    foreach (array(
    ) as $filename) {

      // The OS caches file_exists() and PHP caches require_once(), so
      // we'll let both of those take care of performance here.
      if (file_exists($filename)) {
        require_once $filename;