*Add $wgCustomJobs for adding functions/subclasses to jobqueue
This commit is contained in:
parent
663d697bae
commit
b8cd62a858
2 changed files with 19 additions and 4 deletions
|
|
@ -1359,6 +1359,12 @@ $wgWantedPagesThreshold = 1;
|
|||
/** Enable slow parser functions */
|
||||
$wgAllowSlowParserFunctions = false;
|
||||
|
||||
/**
|
||||
* Extra custom jobs can be added to the Job Queue system.
|
||||
* This array should consist of job name => job queue subclass pairs
|
||||
*/
|
||||
$wgCustomJobs = array();
|
||||
|
||||
/**
|
||||
* To use inline TeX, you need to compile 'texvc' (in the 'math' subdirectory of
|
||||
* the MediaWiki package and have latex, dvips, gs (ghostscript), andconvert
|
||||
|
|
|
|||
|
|
@ -174,14 +174,23 @@ abstract class Job {
|
|||
case 'refreshLinks':
|
||||
return new RefreshLinksJob( $title, $params, $id );
|
||||
case 'htmlCacheUpdate':
|
||||
return;
|
||||
case 'html_cache_update': # BC
|
||||
return new HTMLCacheUpdateJob( $title, $params['table'], $params['start'], $params['end'], $id );
|
||||
case 'sendMail':
|
||||
return new EmaillingJob($params);
|
||||
return new EmaillingJob( $params );
|
||||
case 'enotifNotify':
|
||||
return new EnotifNotifyJob($title, $params);
|
||||
default:
|
||||
throw new MWException( "Invalid job command \"$command\"" );
|
||||
return new EnotifNotifyJob( $title, $params );
|
||||
}
|
||||
// OK, check if this is a custom job
|
||||
global $wgCustomJobs;
|
||||
wfLoadAllExtensions(); // This may be for an extension
|
||||
|
||||
if( isset($wgCustomJobs[$command]) ) {
|
||||
$class = $wgCustomJobs[$command];
|
||||
return new $class($title, $params, $id);
|
||||
} else {
|
||||
throw new MWException( "Invalid job command \"$command\"" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue