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

Breadcrumb

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

function Snapshot::snapshotGlobals

1 call to Snapshot::snapshotGlobals()
Snapshot::__construct in vendor/sebastian/global-state/src/Snapshot.php

File

vendor/sebastian/global-state/src/Snapshot.php, line 202

Class

Snapshot
A snapshot of global state.

Namespace

SebastianBergmann\GlobalState

Code

private function snapshotGlobals() : void {
    $superGlobalArrays = $this->superGlobalArrays();
    foreach ($superGlobalArrays as $superGlobalArray) {
        $this->snapshotSuperGlobalArray($superGlobalArray);
    }
    foreach (array_keys($GLOBALS) as $key) {
        if ($key !== 'GLOBALS' && !in_array($key, $superGlobalArrays, true) && $this->canBeSerialized($GLOBALS[$key]) && !$this->excludeList
            ->isGlobalVariableExcluded($key)) {
            
            /* @noinspection UnserializeExploitsInspection */
            $this->globalVariables[$key] = unserialize(serialize($GLOBALS[$key]));
        }
    }
}
RSS feed
Powered by Drupal