From: physikerwelt Date: Mon, 21 Dec 2015 13:29:02 +0000 (+0100) Subject: Set $_SERVER['SERVER_NAME'] to the value set by --server X-Git-Tag: 1.31.0-rc.0~813^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/%7Bmainpage%7D?a=commitdiff_plain;h=2de3bf45d12d8d279ae13675500b4ffde65bf5fa;p=lhc%2Fweb%2Fwiklou.git Set $_SERVER['SERVER_NAME'] to the value set by --server For wiki families that use the "Wikimedia Method" to have domain dependant wikis the server variable 'SERVER_NAME' might be used to get the database name. c.f. https://www.mediawiki.org/wiki/Manual:Wiki_family#Wikimedia_Method This change sets $_SERVER['SERVER_NAME'] to the commandline option passed as --server to enable the correct loading of the LocalSettings.php Change-Id: I7e5c009c2403f6c93e81422a8376d7deee4d2b5a --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 174b9732dd..ec5499363e 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1170,6 +1170,9 @@ abstract class Maintenance { "must exist and be readable in the source directory.\n" . "Use --conf to specify it.", true ); } + if ( isset( $this->mOptions['server'] ) ) { + $_SERVER['SERVER_NAME'] = $this->mOptions['server']; + } $wgCommandLineMode = true; return $settingsFile;