X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJob.php;h=2d13c7e5e5b03706a7e6b09226fb2587d9adaa5d;hb=793dbbb870657541c1d9b7c2ccd7628214d4a3fb;hp=3e23391cdf0e488a9010351ae3837663b0b35da1;hpb=e19a52f2f5376b08c303d31bdcfec56da560f2b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index 3e23391cdf..2d13c7e5e5 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -64,12 +64,17 @@ abstract class Job implements IJobSpecification { */ public static function factory( $command, Title $title, $params = array() ) { global $wgJobClasses; + if ( isset( $wgJobClasses[$command] ) ) { $class = $wgJobClasses[$command]; - return new $class( $title, $params ); + $job = new $class( $title, $params ); + $job->command = $command; + + return $job; } - throw new MWException( "Invalid job command `{$command}`" ); + + throw new InvalidArgumentException( "Invalid job command '{$command}'" ); } /**