3 $optionsWithArgs = array( 'maxjobs' );
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'];
15 // Trigger errors on inappropriate use of $wgTitle
16 $wgTitle = new FakeTitle
;
18 $dbw =& wfGetDB( DB_MASTER
);
20 while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
21 while ( false != ($job = Job
::pop()) ) {
23 print $job->id
. " " . $job->toString() . "\n";
25 print "Error: {$job->error}\n";
27 if ( $maxJobs && ++
$n > $maxJobs ) {