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

Breadcrumb

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

function Database::commitAllOnShutdown

Calls commitAll() on all the open connections.

If drupal_register_shutdown_function() exists the commit will occur during shutdown so that it occurs at the latest possible moment.

@internal This method exists only to work around a bug caused by Drupal incorrectly relying on object destruction order to commit transactions. Xdebug 3.3.0 changes the order of object destruction when the develop mode is enabled.

Parameters

bool $shutdown: Internal param to denote that the method is being called by _drupal_shutdown_function().

Return value

void

1 call to Database::commitAllOnShutdown()
Transaction::__construct in core/lib/Drupal/Core/Database/Transaction.php

File

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

Class

Database
Primary front-controller for the database system.

Namespace

Drupal\Core\Database

Code

public static function commitAllOnShutdown(bool $shutdown = FALSE) : void {
    static $registered = FALSE;
    if ($shutdown) {
        foreach (self::$connections as $targets) {
            foreach ($targets as $connection) {
                if ($connection instanceof Connection) {
                    $connection->commitAll();
                }
            }
        }
        return;
    }
    if (!function_exists('drupal_register_shutdown_function')) {
        return;
    }
    if (!$registered) {
        $registered = TRUE;
        drupal_register_shutdown_function('\\Drupal\\Core\\Database\\Database::commitAllOnShutdown', TRUE);
    }
}

API Navigation

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