From: Timo Tijhof Date: Tue, 27 Mar 2018 01:27:24 +0000 (-0700) Subject: maintenance: Document secondary purpose of --server X-Git-Tag: 1.31.0-rc.0~98^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=af46a3351c0a392f9d8e14291bd622475d1ec33c;p=lhc%2Fweb%2Fwiklou.git maintenance: Document secondary purpose of --server Follows-up to 2de3bf45d12d8. That commit references "Wikimedia Method" of https://www.mediawiki.org/wiki/Manual:Wiki_family. This is slightly confusing given that page explicitly states that hostname-based detection is only used on the web server, with code for MW_DB and --wiki in place. Nonetheless, despite this being seemingly unused, unadvertised and undocumented, if we're going to support this, we might as well document what its for, to avoid it being removed without notice in the future. Change-Id: I9ff333b6e9f15cfe4de21ef01a47931dd73d297e --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 0c79bd51e5..624bbae8cc 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1208,6 +1208,12 @@ abstract class Maintenance { } define( 'MW_DB', $bits[0] ); define( 'MW_PREFIX', $bits[1] ); + } elseif ( isset( $this->mOptions['server'] ) ) { + // Provide the option for site admins to detect and configure + // multiple wikis based on server names. This offers --server + // as alternative to --wiki. + // See https://www.mediawiki.org/wiki/Manual:Wiki_family + $_SERVER['SERVER_NAME'] = $this->mOptions['server']; } if ( !is_readable( $settingsFile ) ) { @@ -1215,9 +1221,6 @@ abstract class Maintenance { "must exist and be readable in the source directory.\n" . "Use --conf to specify it." ); } - if ( isset( $this->mOptions['server'] ) ) { - $_SERVER['SERVER_NAME'] = $this->mOptions['server']; - } $wgCommandLineMode = true; return $settingsFile;