final public static function Database::removeConnection

Remove a connection and its corresponding connection information.

Parameters

$key: The connection key.

Return value

TRUE in case of success, FALSE otherwise.

4 calls to Database::removeConnection()
Tasks::connect in drupal/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php
Check database connection and attempt to create database if the database is missing.
Tasks::connect in drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
Check database connection and attempt to create database if the database is missing.
Tasks::connect in drupal/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
Check database connection and attempt to create database if the database is missing.
TestBase::tearDown in drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
Deletes created files, database tables, and reverts all environment changes.

File

drupal/core/lib/Drupal/Core/Database/Database.php, line 339
Definition of Drupal\Core\Database\Database

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

public static final function removeConnection($key) {
  if (isset(self::$databaseInfo[$key])) {
    self::closeConnection(NULL, $key);
    unset(self::$databaseInfo[$key]);
    return TRUE;
  }
  else {
    return FALSE;
  }
}