maintenance: Document secondary purpose of --server
[lhc/web/wiklou.git] / maintenance / Maintenance.php
index 0c79bd5..624bbae 100644 (file)
@@ -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;