Index: trunk/phase3/includes/JobQueue.php |
— | — | @@ -174,15 +174,24 @@ |
175 | 175 | case 'refreshLinks': |
176 | 176 | return new RefreshLinksJob( $title, $params, $id ); |
177 | 177 | case 'htmlCacheUpdate': |
| 178 | + return; |
178 | 179 | case 'html_cache_update': # BC |
179 | 180 | return new HTMLCacheUpdateJob( $title, $params['table'], $params['start'], $params['end'], $id ); |
180 | 181 | case 'sendMail': |
181 | | - return new EmaillingJob($params); |
| 182 | + return new EmaillingJob( $params ); |
182 | 183 | case 'enotifNotify': |
183 | | - return new EnotifNotifyJob($title, $params); |
184 | | - default: |
185 | | - throw new MWException( "Invalid job command \"$command\"" ); |
| 184 | + return new EnotifNotifyJob( $title, $params ); |
186 | 185 | } |
| 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 | + } |
187 | 196 | } |
188 | 197 | |
189 | 198 | static function makeBlob( $params ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1360,6 +1360,12 @@ |
1361 | 1361 | $wgAllowSlowParserFunctions = false; |
1362 | 1362 | |
1363 | 1363 | /** |
| 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 | +/** |
1364 | 1370 | * To use inline TeX, you need to compile 'texvc' (in the 'math' subdirectory of |
1365 | 1371 | * the MediaWiki package and have latex, dvips, gs (ghostscript), andconvert |
1366 | 1372 | * (ImageMagick) installed and available in the PATH. |