r23162 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23161‎ | r23162 | r23163 >
Date:14:12, 21 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Add $wgCustomJobs for adding functions/subclasses to jobqueue
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/JobQueue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/JobQueue.php
@@ -174,15 +174,24 @@
175175 case 'refreshLinks':
176176 return new RefreshLinksJob( $title, $params, $id );
177177 case 'htmlCacheUpdate':
 178+ return;
178179 case 'html_cache_update': # BC
179180 return new HTMLCacheUpdateJob( $title, $params['table'], $params['start'], $params['end'], $id );
180181 case 'sendMail':
181 - return new EmaillingJob($params);
 182+ return new EmaillingJob( $params );
182183 case 'enotifNotify':
183 - return new EnotifNotifyJob($title, $params);
184 - default:
185 - throw new MWException( "Invalid job command \"$command\"" );
 184+ return new EnotifNotifyJob( $title, $params );
186185 }
 186+ // OK, check if this is a custom job
 187+ global $wgCustomJobs;
 188+ wfLoadAllExtensions(); // This may be for an extension
 189+
 190+ if( isset($wgCustomJobs[$command]) ) {
 191+ $class = $wgCustomJobs[$command];
 192+ return new $class($title, $params, $id);
 193+ } else {
 194+ throw new MWException( "Invalid job command \"$command\"" );
 195+ }
187196 }
188197
189198 static function makeBlob( $params ) {
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1360,6 +1360,12 @@
13611361 $wgAllowSlowParserFunctions = false;
13621362
13631363 /**
 1364+ * Extra custom jobs can be added to the Job Queue system.
 1365+ * This array should consist of job name => job queue subclass pairs
 1366+ */
 1367+$wgCustomJobs = array();
 1368+
 1369+/**
13641370 * To use inline TeX, you need to compile 'texvc' (in the 'math' subdirectory of
13651371 * the MediaWiki package and have latex, dvips, gs (ghostscript), andconvert
13661372 * (ImageMagick) installed and available in the PATH.

Follow-up revisions

RevisionCommit summaryAuthorDate
r23203Merged revisions 23120-23202 via svnmerge from...david09:07, 22 June 2007

Status & tagging log