function DatabaseDriverList::get

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

Returns a single extension.

Parameters

string $extension_name: The machine name of the extension.

Return value

\Drupal\Core\Extension\Extension A processed extension object for the extension with the specified machine name.

Overrides ExtensionList::get

File

core/lib/Drupal/Core/Extension/DatabaseDriverList.php, line 132

Class

DatabaseDriverList
Provides a list of available database drivers.

Namespace

Drupal\Core\Extension

Code

public function get($extension_name) {
  if (!str_contains($extension_name, "\\")) {
    throw new \RuntimeException("Passing a database driver name '{$extension_name}' to " . __METHOD__ . '() is not supported. Pass a database driver namespace instead. See https://www.drupal.org/node/3258175');
  }
  return parent::get($extension_name);
}

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