Cli/guide/Docker-Development-Environment/LocalSettings.php
The development environment automatically sets various MediaWiki settings, such as database details.
It does this by using a shim at the top of LocalSettings.php.
The Shim
editThe most basic LocalSettings.php file for you environment, that only includes the shim, looks like this:
<?php
//require_once "$IP/includes/PlatformSettings.php";
require_once '/mwdd/MwddSettings.php';
This will load a file that sets various settings. https://gitlab.wikimedia.org/repos/releng/cli/-/blob/main/internal/mwdd/files/embed/mediawiki/MwddSettings.php
For example:
- $wgServer
- $wgDBname
- $wgDBservers
- $wgSMTP
- $wgObjectCaches
- etc...
Further configuration
editYou should should include any further settings after the shim, and you can override anything that the shim has previously set.
For example:
<?php
//require_once "$IP/includes/PlatformSettings.php";
require_once '/mwdd/MwddSettings.php';
wfLoadSkin('Vector');
wfLoadExtension( 'BoilerPlate' );
$wgBoilerPlateVandalizeEachPage = true;
$wgEnableParserCache = false;
Existing configuration
editIf you are moving from an existing MediaWiki configuration, take a look at the shim and remove things such as DB settings that will automatically be set.
Add the shim to the top of your file, and you should be set!
FAQ
editWhy is PlatformSettings.php commented out?
editThe string was at some point expected in LocalSettings.php by some part of the release engineering development docker images, so the comment was added. It may no longer be needed and may be removed in the future.