X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMediaWiki.php;h=1b014f6f649dedd5ac8f1ae97f57d3f57e32c9f6;hb=b59fe387766b1aaf117f04abd7e3a070f2e11b11;hp=76530cbd9ab61ef0b78a85688311636a1963c934;hpb=66d3eb56afc737e4e5ee66f7cad1dc78d1aec6b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 76530cbd9a..1b014f6f64 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -38,7 +38,9 @@ class MediaWiki { */ public function request( WebRequest $x = null ) { $old = $this->context->getRequest(); - $this->context->setRequest( $x ); + if ( $x ) { + $this->context->setRequest( $x ); + } return $old; } @@ -48,7 +50,9 @@ class MediaWiki { */ public function output( OutputPage $x = null ) { $old = $this->context->getOutput(); - $this->context->setOutput( $x ); + if ( $x ) { + $this->context->setOutput( $x ); + } return $old; } @@ -662,9 +666,9 @@ class MediaWiki { } if ( !$wgRunJobsAsync ) { - // If running jobs asynchronously has been disabled, run the job here - // while the user waits - SpecialRunJobs::executeJobs( $n ); + // Fall back to running the job here while the user waits + $runner = new JobRunner(); + $runner->run( array( 'maxJobs' => $n ) ); return; } @@ -697,7 +701,8 @@ class MediaWiki { if ( !$sock ) { wfDebugLog( 'runJobs', "Failed to start cron API (socket error $errno): $errstr\n" ); // Fall back to running the job here while the user waits - SpecialRunJobs::executeJobs( $n ); + $runner = new JobRunner(); + $runner->run( array( 'maxJobs' => $n ) ); return; }