Jump to content

Manual:SettingsBuilder.php

From mediawiki.org

A utility class for loading files that contain settings, experimentally introduced in MW 1.38. The class serves to construct a Config object from a variety of sources. It is used by MediaWiki core in Setup,php.

With LocalSettings.php

[edit]

The SettingsBuilder class offers the following methods for use in LocalSettings.php:

  • loadFile( $path ) - load settings from a YAML or JSON file. Note that configuration loaded into the SettingsBuilder will generally not become available in the file scope of LocalSettings.php. However, you should not rely on this, as it depends on interactions with global variables in the background which is subject to change.
  • putConfigValue( $name, $value ) - update a single config setting. $value will be combined with any pre-existing value according to the merge strategy applicable to this variable.
  • overrideConfigValue( $name, $value ) - set a single config setting, overriding any previous values.
  • getConfig() - get a Config object containing any configuration loaded so far.

Again, please keep in mind that this interface is experimental and subject to change without notice.

See also

[edit]