Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This line from bootstrap.inc in drupal_settings_initialize() says:
// Export the following settings.php variables to the global namespace
global $databases, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url;
At least a couple of these global variables seem to be left over from Drupal 6 and should be removed (they aren't being used anywhere else in Drupal and aren't in default.settings.php any more):
$db_url
$installed_profile
I think the others are still valid.
Comments
Comment #1
swentel CreditAttribution: swentel commented$db_url is needed for the update process from D6 to D7.
$installed_profile however seems something which might be deleted.
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commentedMoving to Drupal 8.
I just tried a number of searches through every file included with D8 and I couldn't find any results for $installed_profile. There is some use of $db_url as swentel mentions. If $db_url isn't necessary for the D7 - D8 upgrade process I think it could go too (for D8, not D7 obviously).
Attached is a patch that only removes $installed_profile. Lets see what the test bot has to say.
Comment #3
catchShould be fine to remove $db_url in D8 as well.
Comment #4
Devin Carlson CreditAttribution: Devin Carlson commentedUpdated to remove $installed_profile, $db_url and the one reference to $db_url in bootstrap.inc.
Also changed the issue title and category.
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedOops, selected the wrong brackets when I pressed delete.
Comment #7
jhodgdon#6: 842216-remove-leftover-global-variables-updated.patch queued for re-testing.
Comment #9
valthebald$db_url has gone earlier, changing title
Comment #10
Devin Carlson CreditAttribution: Devin Carlson commentedThe patch in #9 applied cleanly and removed the only instance of the unused
$installed_profile
global variable.Comment #11
alexpottCommitted 9263a49 and pushed to 8.x. Thanks!