public function DatabaseConnection::getDriverClass

public DatabaseConnection::getDriverClass($class, array $files = array(), $use_autoload = FALSE)

Gets the driver-specific override class if any for the specified class.

Parameters

string $class: The class for which we want the potentially driver-specific class.

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

$use_autoload: If TRUE, attempt to load classes using PHP's autoload capability as well as the manual approach here.

Return value

string The name of the class that should be used for this driver.

File

includes/database/database.inc, line 780
Core systems for the database layer.

Class

DatabaseConnection
Base Database API class.

Code

public function getDriverClass($class, array $files = array(), $use_autoload = FALSE) {
  if (empty($this->driverClasses[$class])) {
    $driver = $this->driver();
    $this->driverClasses[$class] = $class . '_' . $driver;
    Database::loadDriverFile($driver, $files);
    if (!class_exists($this->driverClasses[$class], $use_autoload)) {
      $this->driverClasses[$class] = $class;
    }
  }
  return $this->driverClasses[$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/includes!database!database.inc/function/DatabaseConnection::getDriverClass/7.x