function Database::setActiveConnection
Sets the active connection to the specified key.
Return value
string|null The previous database connection key.
5 calls to Database::setActiveConnection()
- DbImportCommand::runScript in core/
lib/ Drupal/ Core/ Command/ DbImportCommand.php - Run the database script.
- Tasks::connect in core/
lib/ Drupal/ Core/ Database/ Install/ Tasks.php - Checks if we can connect to the database.
- Tasks::connect in core/
modules/ pgsql/ src/ Driver/ Database/ pgsql/ Install/ Tasks.php - Checks if we can connect to the database.
- Tasks::connect in core/
modules/ sqlite/ src/ Driver/ Database/ sqlite/ Install/ Tasks.php - Checks if we can connect to the database.
- Tasks::connect in core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Install/ Tasks.php - Checks if we can connect to the database.
File
-
core/
lib/ Drupal/ Core/ Database/ Database.php, line 173
Class
- Database
- Primary front-controller for the database system.
Namespace
Drupal\Core\DatabaseCode
public static final function setActiveConnection($key = 'default') {
if (!empty(self::$databaseInfo[$key])) {
$old_key = self::$activeKey;
self::$activeKey = $key;
return $old_key;
}
}