final public static function Database::setActiveConnection
7.x database.inc | final public static Database::setActiveConnection($key = 'default') |
Sets the active connection to the specified key.
Return value
The previous database connection key.
1 call to Database::setActiveConnection()
- db_set_active in drupal-7.x/
includes/ database/ database.inc - Sets a new active database.
File
- drupal-7.x/
includes/ database/ database.inc, line 1502 - Core systems for the database layer.
Class
- Database
- Primary front-controller for the database system.
Code
final public static function setActiveConnection($key = 'default') {
if (empty(self::$databaseInfo)) {
self::parseConnectionInfo();
}
if (!empty(self::$databaseInfo[$key])) {
$old_key = self::$activeKey;
self::$activeKey = $key;
return $old_key;
}
}