Remove DrupalKernel::initializeRequestGlobals and replace base_root, base_url and base_path with a service

Created on 8 July 2015, over 9 years ago
Updated 16 September 2024, 3 months ago

Problem/Motivation

The global variables base_url, base_path and base_root as well as the base_path() function are still used throughout core. Removal of those is tricky, since there is no direct replacement on the Symfony request object for those. The globals in Drupal are always relative to the application directory, while Symfony $request->getBaseUrl() returns the base URL relative to the front controller.

For example when running the installer (hxxp://example.com/drupal/core/install.php), Symfony will report the base URL including the core path, while $base_url will only be up to drupal.

Proposed resolution

Since there is no direct replacement in Symfony, it is necessary to introduce an additional service which is capable of returning the base URL and the base path relative to the application (not the front controller).

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Base  →

Last updated 2 days ago

Created by

🇨🇭Switzerland znerol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024