Same name and namespace in other branches
  1. 8.9.x core/includes/install.inc \_drupal_rewrite_settings_global()
  2. 9 core/includes/install.inc \_drupal_rewrite_settings_global()

Helper for drupal_rewrite_settings().

Makes the new settings global.

Parameters

array|null $ref: A reference to a nested index in $GLOBALS.

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

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use SettingsEditor::rewrite() instead. As internal API, _drupal_rewrite_settings_global() may also be removed in a minor release.

See also

https://www.drupal.org/node/3244583

File

core/includes/install.inc, line 358
API functions for installing modules and themes.

Code

function _drupal_rewrite_settings_global(&$ref, $variable) {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use SettingsEditor::rewrite() instead. As internal API, ' . __FUNCTION__ . '() may also be removed in a minor release. See https://www.drupal.org/node/3244583', E_USER_DEPRECATED);
  if (is_object($variable)) {
    $ref = $variable->value;
  }
  else {
    foreach ($variable as $k => $v) {
      _drupal_rewrite_settings_global($ref[$k], $v);
    }
  }
}