Configuration for Wikimedia Foundation wikis. This is a mirror from https://gerrit.wikimedia.org. See https://www.mediawiki.org/wiki/Developer_access for contributing.
HTML PHP Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dblists Don't use computed dblist in production (nowikidatadescriptiontaglines) Feb 14, 2017
docroot Don't use computed dblist in production (nowikidatadescriptiontaglines) Feb 14, 2017
errorpages Move /docroot/default/index.html to /errorpages Jul 1, 2016
fonts @ f6d4ad3 Drop '.ttf' from $wgTimelineFontFile + bump epoch Dec 5, 2016
images Replaces "/images" directory with symlinks Feb 21, 2016
multiversion Multiversion: Don't trigger a PHP warning on non-500 errors Feb 21, 2017
portals @ 13e001a Bumping wikipedia.org portal to master Feb 21, 2017
private Add example PrivateSettings file Mar 17, 2015
rpc Swap rpc/RunJobs.php to use MWMultiVersion::getMediaWiki() Jan 17, 2017
scap/plugins scap prep: fix subprocess calls for master Feb 21, 2017
static Update Hebrew wordmark logo Feb 14, 2017
tests Multiversion: Don't trigger a PHP warning on non-500 errors Feb 21, 2017
w Rewrite extract2 to handle Article::getContent() disappearing Jan 25, 2017
wmf-config Enable TwoColConflict extension on arwiki Feb 21, 2017
.arcconfig Arcanist configuration Nov 20, 2015
.arclint Add basic linter config for arcanist Mar 18, 2016
.gitignore Scap swat command Dec 20, 2016
.gitmodules Adding fonts to version control Nov 14, 2016
.gitreview Initial commit Feb 25, 2012
README Add X-Wikimedia-Debug config Nov 21, 2016
composer.json build: Update PHPUnit from 3.7 to 4.8, add phplint to composer-test Jan 10, 2017
composer.lock build: Update PHPUnit from 3.7 to 4.8, add phplint to composer-test Jan 10, 2017
debug.json debug.json: update eqiad debug hosts Nov 22, 2016
fc-list updated fonts list and sorted it, rt #810 Apr 16, 2014
langlist Initial configuration for olo.wikipedia.org Oct 6, 2016
langlist-labs Split langlist for beta Sep 23, 2015
php Revert "Revert "Group0 to 1.29.0-wmf.12"" Feb 15, 2017
phpunit.xml phpunit: exclude tests in 'Disabled' group Jun 26, 2012
refresh-dblist MWWikiversions::readDbListFile() update callers for Ie6c2fd3129dd Oct 11, 2015
requirements.txt Scap swat command Dec 20, 2016
robots.txt Fix an invalid empty line in the global robots.txt Oct 3, 2016
search-redirect.php search-redirect: check for parameter existence consistently Dec 4, 2014
setup.py Scap swat command Dec 20, 2016
test-requirements.txt Scap swat command Dec 20, 2016
tox.ini Scap swat command Dec 20, 2016
typos Added a new commonly typed typo Oct 25, 2016
wikiversions-labs.json Add German Wiktionary in beta (2nd try) Nov 16, 2016
wikiversions.json group0 to wmf.13 Feb 21, 2017

README

operations/mediawiki-config.git
-------------------------------

Files in this repository are almost a mirror of the Wikimedia Foundation
cluster configuration. Omitted files include passwords and security measures.

*.dblist
 List of databases. To vary by realm (e.g. 'production', 'labs'), add the realm
as a suffix before the extension, separated with a dash. Example:
	"all-labs.dblist".

wikiversions.json, wikiversions.php
wikiversions-labs.json, wikiversions-labs.php
 Let us associate a database with a specific copy of MediaWiki (generally a
branch). The .cdb file is updated by editing wikiversions.json first and then
running multiversion/refreshWikiversions. To vary by realm, add a suffix
before the extension, e.g. "wikiversions-labs.json".

debug.json
 Configuration for X-Wikimedia-Debug. The browser extensions use this to
 determine which app servers are available to use as X-Wikimedia-Debug
 backends. See <https://wikitech.wikimedia.org/wiki/X-Wikimedia-Debug>.

docroot/
 The Apache document root for several of our VirtualHosts.

images/
 Shared pictures for the unified login system used by CentralAuth.

w/
 The "w/" directory in the docroot of any MediaWiki-serving VirtualHost.

tests/
 Hold some PHPUnit tests.

wmf-config/
 The MediaWiki configuration for all database. Think of it like a huge
LocalSettings.php.

wmf-config/CommonSettings.php
 Generic configuration such as including extensions or calling over piece
 of configuration. This is mostly shared among all wikis.

wmf-config/InitialiseSettings.php
 Per wiki configuration.

wmf-config/db.php
 Databases related configuration.

wmf-config/mc.php
 Memcached configuration.

wmf-config/*-labs.php
 Files used by the beta cluster to override production settings.


By using getRealmSpecificFilename(), from multiversion/MWRealm.php, one can
have configuration loaded depending on the realm or the datacenter the file is
executed on.  The function will test out several file suffixes and return the
filename of the first match.  The detection order is:

 - realm datacenter
 - realm
 - datacenter

Falling back to the filename given as argument.

Example, per datacenter:

 Given the files:
  - mc-codfw.php
  - mc.php

 The call to getRealmSpecificFilename( 'mc.php' ) will return:

  - on codfw: mc-codfw.php
  - on any other datacenter (e.g. eqiad): mc.php


Example per realm with a non php file extension:

 Given the files
  - db-production.log
  - db-labs.log

 The call to getRealmSpecificFilename( 'db.log' ) will return:

  - in a labs instance: 'db-labs.log'
  - on a production server: 'db-production.log'

A more complicated example:

 Given the files:
  - log-production.php
  - log-eqiad.php
  - log.php

 The call to getRealmSpecificFilename( 'log.php' ) will return:

  - in labs eqiad: 'log-eqiad.php'
  - in a non-existent labs DC that's not eqiad: 'log.php'
  - in production codfw: 'log-production.php'
  - in production eqiad: 'log-production.php'

 The last case is because the realm takes precedence over the datacenter.
 You can also use a realm/datacenter suffix:
  'log-production-eqiad.php'.

You can find more examples in tests/multiversion/MWRealmTest.php.