Problem

  • The base system allows plenty of services and parameters to be overridden via settings.php, but the setting names and values are very inconsistent.
  • Possible overrides are undocumented and hard to grep, because "Settings" is ambiguously used by JavaScript, Ajax, Entity Field API, Plugins, etc.

Goal

  • Make the setting names consistent.
  • (optional) Consider to add (very short) docs somewhere (not default.settings.php).

Details

Note: This list may be incomplete.

Setting Value Usage
diff_context_lines_leading integer
diff_context_lines_trailing integer
php_storage array map of bin (or "default") to storage config PhpStorageFactory::get()
cache array map of bin (or "default") to service ID CacheFactory::get()
drupal_bootstrap_config_storage callable (Config\StorageInterface) BootstrapConfigStorageFactory::get()
extension_discovery_scan_tests boolean #2198713: Add a settings.php variable to allow to discover/enable test extensions at regular runtime
keyvalue_service_[collection] service ID KeyValueFactory::get()
keyvalue_default service ID KeyValueFactory::get()
queue_reliable_service_[queue] service ID QueueFactory::get()
queue_service_[queue] service ID QueueFactory::get()
queue_default service ID QueueFactory::get()
$conf['container_service_providers'] array map of "name" to FQCN DrupalKernel::discoverServiceProviders()
$conf['container_yamls'] array of service yaml filepaths DrupalKernel::discoverServiceProviders()
yaml_parser_class FQCN #1920902: Add a Drupal Yaml wrapper so we can default to PECL Yaml component if it is available

Notes

  • Ideally, we'd simply introduce a new annotation for individual settings in their originating place, like this:
    /**
     * ...
     *
     * @setting array cache
     *   An associative array whose keys are cache bins and whose values
     *   are service IDs. If the requested cache bin is not defined, then
     *   the 'default' bin key is checked. Defaults to 'cache.backend.database'.
     */
    class CacheFactory extends ContainerAware {
    
CommentFileSizeAuthor
#6 settings.php-2160705-6.patch76.91 KBmgifford

Comments

sun’s picture

sun’s picture

FWIW, #1757536: Move settings.php to /settings directory, fold sites.php into settings.php moves the default settings file into /core/default.settings.php

Based on that, I wonder whether we couldn't have two separate files, like this?

/core/settings.default.php
/core/settings.advanced.php

The advanced file would allow us to document all of the internal/hidden settings that are mentioned in the OP. At the same time, we can move more advanced settings from the default file into the advanced file, so as to end up with ~10KB instead of the current 30+KB :-)

sun’s picture

Crell’s picture

+14,912 to #2. Whether we move the files or not, our current settings.php file is so huge it's almost unusable.

sun’s picture

mgifford’s picture

Status: Active » Needs review
StatusFileSize
new76.91 KB

Just to get things rolling on this issue. Here's a patch that I think addresses #2.

Doesn't address the more important elements here, but hoping to nudge this along. A smaller default should be much easier for people to navigate.

There are some other inconsistencies in the default.settings.php that could be cleaned up too.

Status: Needs review » Needs work

The last submitted patch, 6: settings.php-2160705-6.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jibran’s picture

Version: 8.1.x-dev » 8.2.x-dev
Category: Bug report » Task

How is this a bug?

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone credited darvanen.

quietone’s picture

This issue was discussed at a Bug Smash Initiative group triage meeting, with both darvanen and larowlan adding to the discussion. As a result some of the related/child issue have been closed.

The scope of this issue results in a large documentation patch covering many areas of settings.php. This issue should be a Meta with work done on the various topics done in smaller child issue. Adding tags for re scoping and issue summary update.

We did not review the existing patch for accuracy or if the suggested changes have already been made.

Adding credit for triage

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.