Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Database.php

function 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.

6 calls to Database::removeConnection()
DbCommandBase::getDatabaseConnection in core/lib/Drupal/Core/Command/DbCommandBase.php
Parse input options decide on a database.
FunctionalTestSetupTrait::doInstall in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Execute the non-interactive installer.
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.

... See full list

File

core/lib/Drupal/Core/Database/Database.php, line 381

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;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal