Manual:$wgConf

Details
Create a site configuration object. Not used for much in a default install.

This is used on Wikimedia's mass installation to provide a centralized configuration file for a few hundred wikis, providing defaults per site group and per-wiki overrides.

It can be a bit confusing, though. :)

Currently needed by Extension:CentralAuth to fetch per-site information, eg linking to the proper user pages on each wiki.

Configuration
Wikis are grouped by the suffix on their database names; on a large installation there may be eg 'enwiki' and 'enwiktionary' and 'enwikibooks', each in a different suffix group. Suffixes have to be declared in the  member variable of $wgConf if you want to use.

Settings may be assigned to (from the less specific to the more specific):
 * 'default' to affect all wikis
 * a suffix (eg 'wiki' or 'wiktionary') to affect all in that suffix group (can be determined with )
 * a wiki tag (since 1.12.0)
 * a specific DB name.

When extracting global settings, the object will search first the more specific level (the last one in the list above) and if it doesn't find the setting, it will search in less specific levels. When it finds one, if won't search for less specific ones. This means that you have to pay attention for some specific settings, such as $wgGroupPermissions, because it doesn't merge the setting with less specific levels, nor the default value (the one in DefaultSettings.php), you'll need to do it by yourself.

For string settings, you can define parameters that will be replaced when extracting the settings. It can be useful when the setting has the same format for all wikis. The format is. Be careful to use single quotes or to escape the    or it will be replaced with the PHP variable (that can be not defined at that time).

To extract the settings in global variables, you can use.

Parameters are:
 * : Wiki's database name (generally $wgDBname). You have to define it yourself.
 * : Wiki's suffix, used to to get the suffix level.
 * : array of parameters mapping its name to its value.
 * : (since 1.12.0) array of wiki tags.

Example
This example uses 3 wikis:,   and. They are located at  (i.e. ,   and  ).

In this example,  is declared in InitialiseSettings.php, this is not required and can be done in LocalSettings.php.

In LocalSettings.php:

In InitialiseSettings.php:

Wikimedia configuration
To see how Wikimedia uses  to configure its wikis see:
 * CommonSettings.php (Wikimedia's version of LocalSettings.php)
 * InitialiseSettings.php (for )