Manual:$wgVirtualDomainsMapping

From Linux Web Expert

<translate> Database settings</translate>: $wgVirtualDomainsMapping
Mapping of virtual database domains to actual databases.
<translate> Introduced in version:</translate>1.41.0 (Gerrit change 963291; git #8bae6836)
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(array)
<translate> Default value:</translate>[]

Details

Mapping of virtual database domains to actual databases.

Virtual database domains are listed under the DatabaseVirtualDomains property in extensions' extension.json file. Extensions will use a virtual domain name when connecting to a table which they expect might not be in the wiki's main database. This mapping will determine what actual database to connect to.

Usually virtual database domains are used either because on a wikifarm, multiple wikis should share the same table, or because the table contains a lot of data and the extension wants to allow for the flexibility of storing it separately. It's up to the extension to document the expected usage patterns of its virtual DB domains.

If no entry is set, the virtual database domain will be mapped to the main database of the wiki. For example, for routing queries of virtual domain 'vdomain' to 'wikishared' database in 'extension1' cluster. The config should be like this:

[ 'vdomain' => [ 'cluster' => 'extension1', 'db' => 'wikishared' ] ]

If the database needs to be the local domain, just set the 'db' to false.

If you want to get another db in the main cluster, just omit 'cluster'. For example:

[ 'centralauth' => [ 'db' => 'centralauth' ] ]