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

Breadcrumb

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

function Settings::handleDeprecations

Handle deprecated values in the site settings.

Parameters

array $settings: The site settings.

See also

self::getDeprecatedSettings()

1 call to Settings::handleDeprecations()
Settings::initialize in core/lib/Drupal/Core/Site/Settings.php
Bootstraps settings.php and the Settings singleton.

File

core/lib/Drupal/Core/Site/Settings.php, line 219

Class

Settings
Read only settings that are initialized with the class.

Namespace

Drupal\Core\Site

Code

private static function handleDeprecations(array &$settings) : void {
    foreach (self::$deprecatedSettings as $legacy => $deprecation) {
        if (!empty($settings[$legacy])) {
            @trigger_error($deprecation['message'], E_USER_DEPRECATED);
            // Set the new key if needed.
            if (!isset($settings[$deprecation['replacement']])) {
                $settings[$deprecation['replacement']] = $settings[$legacy];
            }
        }
        // Ensure that both keys have the same value.
        if (isset($settings[$deprecation['replacement']])) {
            $settings[$legacy] = $settings[$deprecation['replacement']];
        }
    }
}

API Navigation

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