You are here

final public static function Database::removeConnection in Zircon Profile 8

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

Remove a connection and its corresponding connection information.

Parameters

string $key: The connection key.

Return value

bool TRUE in case of success, FALSE otherwise.

10 calls to Database::removeConnection()
ConnectionUnitTest::testConnectionOpen in core/modules/system/src/Tests/Database/ConnectionUnitTest.php
Tests pdo options override.
DbCommandBase::getDatabaseConnection in core/lib/Drupal/Core/Command/DbCommandBase.php
Parse input options decide on a database.
DbCommandBaseTest::testSpecifyDbUrl in core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
Test supplying database connection as a url.
KernelTestBase::bootEnvironment in core/tests/Drupal/KernelTests/KernelTestBase.php
Bootstraps a basic test environment.
KernelTestBase::tearDownCloseDatabaseConnection in core/tests/Drupal/KernelTests/KernelTestBase.php
@after

... See full list

File

core/lib/Drupal/Core/Database/Database.php, line 339
Contains \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;
  }
}