X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=13fee9c6ca30eb2a0ca79331943148f987c472ad;hp=4d0af5fa78f21de38cd59f03cc0e96845bc767f4;hb=9b670fb797813a8ed35750e2c83fe953a10f349e;hpb=621d00d59bf589d17cf3fa1d18fe55ad5aa91812 diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 4d0af5fa78..13fee9c6ca 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -35,6 +35,10 @@ use Wikimedia\Rdbms\DBReplicationWaitError; // Define this so scripts can easily find doMaintenance.php define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' ); + +/** + * @deprecated since 1.31 + */ define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless $maintClass = false; @@ -509,7 +513,9 @@ abstract class Maintenance { $this->addOption( 'memory-limit', 'Set a specific memory limit for the script, ' - . '"max" for no limit or "default" to avoid changing it' + . '"max" for no limit or "default" to avoid changing it', + false, + true ); $this->addOption( 'server', "The protocol and server name to use in URLs, e.g. " . "http://en.wikipedia.org. This is sometimes necessary because " . @@ -1209,6 +1215,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 ) ) { @@ -1216,9 +1228,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;