X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=527e6cbe72d52db70100fe4b78becea0bf397920;hp=861a61328ebe6c8dcc2af13737f14738ac610620;hb=7babd362babcbf7f20adb8e12edb4f4bc1d4249f;hpb=a26cc32bc57c372277c767b8deb1b695138a89ad diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 861a61328e..527e6cbe72 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -182,7 +182,7 @@ abstract class Maintenance { if ( $count < 2 ) { return false; // sanity } - if ( $bt[0]['class'] !== 'Maintenance' || $bt[0]['function'] !== 'shouldExecute' ) { + if ( $bt[0]['class'] !== self::class || $bt[0]['function'] !== 'shouldExecute' ) { return false; // last call should be to this function } $includeFuncs = [ 'require_once', 'require', 'include', 'include_once' ]; @@ -414,7 +414,10 @@ abstract class Maintenance { $this->fatalError( $err, intval( $die ) ); } $this->outputChanneled( false ); - if ( PHP_SAPI == 'cli' || PHP_SAPI == 'phpdbg' ) { + if ( + ( PHP_SAPI == 'cli' || PHP_SAPI == 'phpdbg' ) && + !defined( 'MW_PHPUNIT_TEST' ) + ) { fwrite( STDERR, $err . "\n" ); } else { print $err; @@ -1207,6 +1210,9 @@ 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;