Uncomment the inclusion of the local setting file

Created on 17 July 2015, about 9 years ago
Updated 1 February 2023, over 1 year ago

At the end of the settings file there is the note about settings.local.php file that could be loaded if it exists so administrators could alter the site configuration for local environments if needed without the need to alter the setting file itself.

Since many projects now work with VCS, uncommenting this would result in overwritten file the next time Drupal core will get updated.

I would personally welcome this to be uncommented by default since the file_exists() in the condition that encapsulates the inclusion of that file is very inexpensive so it would not impact performance.

Feature request
Status

Closed: works as designed

Version

10.1

Component
Configuration 

Last updated 1 day ago

Created by

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

Comments & Activities

Not all content is available!

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

  • 🇬🇧United Kingdom catch

    If you run file_exists() against a non-existing file, there is no caching from PHP at all - the filesystem will check whether the file exists on every single request to Drupal, because it can never guarantee that it's not just been written. See the docs on https://www.php.net/manual/en/function.clearstatcache.php

    How bad this is probably depends on the individual file system, but since settings.php is loaded for the internal page cache, even a small change can have a measurable impact on those pages.

    Also since this issue was created, sites are built with composer which includes scaffolding for settings.php, so it's a lot easier to manage stuff like this in git.

    Marking this works as designed.

Production build 0.71.5 2024