3 $optionsWithArgs = array( 'maxjobs', 'type' );
4 $wgUseNormalUser = true;
5 require_once( 'commandLine.inc' );
6 require_once( "$IP/includes/JobQueue.php" );
7 require_once( "$IP/includes/FakeTitle.php" );
9 if ( isset( $options['maxjobs'] ) ) {
10 $maxJobs = $options['maxjobs'];
16 if ( isset( $options['type'] ) )
17 $type = $options['type'];
19 $wgTitle = Title
::newFromText( 'RunJobs.php' );
21 $dbw = wfGetDB( DB_MASTER
);
25 $conds = "job_cmd = " . $dbw->addQuotes($type);
27 while ( $dbw->selectField( 'job', 'count(*)', $conds, 'runJobs.php' ) ) {
30 $job = ($type == false) ?
32 : Job
::pop_type($type);
38 print $job->id
. " " . $job->toString() . "\n";
41 print "Error: {$job->error}\n";
43 if ( $maxJobs && ++
$n > $maxJobs ) {