function Database::getDriverList

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Database/Database.php \Drupal\Core\Database\Database::getDriverList()

Returns the list provider for available database drivers.

Return value

\Drupal\Core\Extension\DatabaseDriverList The list provider for available database drivers.

File

core/lib/Drupal/Core/Database/Database.php, line 580

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

public static function getDriverList() : DatabaseDriverList {
    if (\Drupal::hasContainer() && \Drupal::hasService('extension.list.database_driver')) {
        return \Drupal::service('extension.list.database_driver');
    }
    else {
        return new DatabaseDriverList(DRUPAL_ROOT, 'database_driver', new NullBackend('database_driver'));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.