*/
public function request( WebRequest $x = null ) {
$old = $this->context->getRequest();
- $this->context->setRequest( $x );
+ if ( $x ) {
+ $this->context->setRequest( $x );
+ }
return $old;
}
*/
public function output( OutputPage $x = null ) {
$old = $this->context->getOutput();
- $this->context->setOutput( $x );
+ if ( $x ) {
+ $this->context->setOutput( $x );
+ }
return $old;
}
}
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;
}
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;
}