*
* @param $command String: Job command
* @param $title Title: Associated title
- * @param $params Array: Job parameters
+ * @param $params Array|bool: Job parameters
* @param $id Int: Job identifier
+ * @throws MWException
* @return Job
*/
static function factory( $command, Title $title, $params = false, $id = 0 ) {
/**
* @param $command
* @param $title
- * @param $params array
- * @param int $id
+ * @param $params array|bool
+ * @param $id int
*/
function __construct( $command, $title, $params = false, $id = 0 ) {
$this->command = $command;
$wgTitle = Title::newFromText( 'RunJobs.php' );
$dbw = wfGetDB( DB_MASTER );
$n = 0;
- $conds = '';
+
if ( $type === false ) {
$conds = Job::defaultQueueConditions( );
} else {
- $conds = "job_cmd = " . $dbw->addQuotes( $type );
+ $conds = array( 'job_cmd' => $type );
}
while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) {