Manual:YAML settings file format

MediaWiki version:
1.39

Settings files are used to configure a MediaWiki instance. They can be written in different formats, including YAML and JSON.

Settings files may contain the following sections (top level keys):

config

edit

The config section contains configuration variables in the form of an associative array (aka an JSON object or dictionary). Each entry in the config section corresponds to on of the configuration settings supported by MediaWiki or an extension. The names of configuration variables are given without the "wg" prefix traditionally used when accessing them as global HP variables.

Configuration values specified in this section may be merged with the default value (or any values previously set from other settings files) using a merge strategy, see Manual:Extension.json/Schema#Merge strategies. The merge strategy to use is determined by the schema defined for this config value, either explicitly or derived from the declared type.

Example:

config:
  Sitename: My Site
  DBname: mysite
  GroupPermissions:
    trusted-users:
      move: true

config-overrides

edit

The config-overrides section works much like the config section, except that values given here will replace any pre-existing values. Any merge strategies implied or explicit in the schema for the configuration variable are ignored.

includes

edit

The includes section contains a list of other settings files to load. The location of these files is interpreted relative to the location of the current settings file. This is especially useful for sharing configuration between several wikis in a wiki farm.

Example:

includes:
  - ../conf/common/Services.yaml

php-ini

edit

The php-ini section contains configuration for the PHP runtime environment. See https://www.php.net/manual/en/ini.list.php

Example:

php-ini:
  memory_limit: 2G
  max_execution_time: 20

extensions

edit

The extensions section contains a list of extension names, each one specifying an extension to load. The extension must be located under the path given by the ExtensionDirectory configuration variable.

Example:

extensions:
  - Echo
  - CategoryTree

skins

edit

The skins section contains a list of skin names, each one specifying a skin to enable. The skin must be located under the path given by the StyleDirectory configuration variable.

Example:

skins:
  - Vector
  - Timeless

config-schema

edit

The config-schema section can be used to define new configuration settings. It mostly useful internally in core or in extensions. There is generally no reason to use it when configuring a wiki site.

Each entry in the config-schema section provides a JSON schema for a configuration variable. In particular, the default and description keys are supported. In addition, the mergeStrategy key can be used to declare how to merge complex values, see Manual:Extension.json/Schema#Merge_strategies.

Example:

config-schema:
  FooBar:
    description: Defines the level bar for foo.
    type: integer
    default: 17

Additional keys:

  • mergeStrategy: TBD
  • ignoreKeys: TBD