function drupal_static_reset

Same name in other branches
  1. 7.x includes/bootstrap.inc \drupal_static_reset()
  2. 9 core/includes/bootstrap.inc \drupal_static_reset()
  3. 8.9.x core/includes/bootstrap.inc \drupal_static_reset()
  4. 11.x core/includes/bootstrap.inc \drupal_static_reset()

Resets one or all centrally stored static variable(s).

Parameters

$name: Name of the static variable to reset. Omit to reset all variables. Resetting all variables should only be used, for example, for running unit tests with a clean environment.

23 calls to drupal_static_reset()
drupal_flush_all_caches in core/includes/common.inc
Rebuilds the container, flushes all persistent caches, resets all variables, and rebuilds all data structures.
FilterAPITest::testDependencyRemoval in core/modules/filter/tests/src/Kernel/FilterAPITest.php
Tests that filter format dependency removal works.
filter_formats_reset in core/modules/filter/filter.module
Resets the text format caches.
FunctionalTestSetupTrait::prepareEnvironment in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Prepares the current environment for running the test.
KernelTestBase::tearDown in core/tests/Drupal/KernelTests/KernelTestBase.php

... See full list

1 string reference to 'drupal_static_reset'
KernelTestBase::tearDown in core/tests/Drupal/KernelTests/KernelTestBase.php

File

core/includes/bootstrap.inc, line 485

Code

function drupal_static_reset($name = NULL) {
    switch ($name) {
        case 'system_get_module_admin_tasks':
            @trigger_error("Calling " . __FUNCTION__ . "() with 'system_get_module_admin_tasks' as an argument is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement for this usage. See https://www.drupal.org/node/3038972", E_USER_DEPRECATED);
        case 'shortcut_current_displayed_set':
            @trigger_error("Calling " . __FUNCTION__ . "() with 'shortcut_current_displayed_set' as an argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. There is no replacement for this usage. See https://www.drupal.org/node/3427050", E_USER_DEPRECATED);
            break;
    }
    drupal_static($name, NULL, TRUE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.