function SettingsEditor::setGlobal

Same name in other branches
  1. 10 core/lib/Drupal/Core/Site/SettingsEditor.php \Drupal\Core\Site\SettingsEditor::setGlobal()

Makes the given setting global.

Parameters

mixed $ref: A reference to a nested index in $GLOBALS.

array|object $variable: The nested value of the setting being copied.

1 call to SettingsEditor::setGlobal()
SettingsEditor::rewrite in core/lib/Drupal/Core/Site/SettingsEditor.php
Replaces values in settings.php with values in the submitted array.

File

core/lib/Drupal/Core/Site/SettingsEditor.php, line 244

Class

SettingsEditor
Generates settings.php files for Drupal installations.

Namespace

Drupal\Core\Site

Code

private static function setGlobal(mixed &$ref, array|object $variable) : void {
    if (is_object($variable)) {
        $ref = $variable->value;
    }
    else {
        foreach ($variable as $k => $v) {
            self::setGlobal($ref[$k], $v);
        }
    }
}

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