Manual:$wgConf/pt-br

Detalhes
Cria um objeto de configuração do site. Não é muito usado em uma instalação padrão.

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.

Pode ser um pouco confuso, no entanto. :) Currently needed by Extension:CentralAuth to fetch per-site information, eg linking to the proper user pages on each wiki.

Configuração
Wikis are grouped by the suffix on their database names; on a large installation there may be e.g. '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.

is the array of settings. Its format is. Settings may be assigned to (from the more specific to the less specific, this is the  part of   as mentioned above):
 * a specific DB name.
 * a wiki tag (since 1.12.0)
 * a suffix (eg 'wiki' or 'wiktionary') to affect all in that suffix group (can be determined with )
 * 'default' to affect all wikis

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).

Versão 1.13 e anteriores
When extracting global settings, the object will search first the more specific level (the first 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.

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.

Versão 1.14 e mais recentes
Alguns novos recursos foram adicionados na versão 1.14.0. A versão 1.13 e anteriores ainda podem ser usadas​​, no entanto.

Função de retorno
Since 1.14, a callback has been introduced to be able to modify the parameters passed to  and related function. It might be used to change parameters when such functions are called after LocalSettings.php (this is the case with CentralAuth). You can define it in. Tht-e callback function will receive the SiteConfiguration object in the first argument and the wiki name in the second one. It has to return an array with the following keys (all optional): They'll be merged with the parameters passed to  and similar functions. If the  and   are filled, the they'll be used to override the default behaviour of.
 * : site's suffix (corresponding to $suffix paramater of  and similar)
 * : site's lang
 * : array of wiki tags (corresponding to $wikiTags parameter)
 * : array of parameters to be replaced (corresponding to $params parameter)

Settings merging
Arrays can now be merged. This might be useful for. To use it, you have to prefix the keys with a "+" for the settings you want to merge. The two possibilities can be used together.
 * To merge your customized version of the setting with the one in DefaultSettings.php, prefix the setting's name with "+" (such as )
 * To merge a more specific level with a less-specific one, prefix the level with a "+".

Example with $wgGroupPermissions:

The basic syntax is thus:

Exemplo
Este exemplo usa 3 wikis:,   e. Elas estão localizadas em  (ou seja, ,   and  ).

Ele assume que  já está definido. In this example,  is declared in InitialiseSettings.php, this is not required and can be done in LocalSettings.php.

Configuração da Wikimedia
Para ver como a Wikimedia usa  para configurar suas wikis consulte:
 * CommonSettings.php (A versão da Wikimedia do LocalSettings.php)
 * InitialiseSettings.php (para )
 * wgConf.php (utilizado pelo CommonSettings.php para inicializar $wgConf)