doxygen -s -u mwdoxgen.cfg :
[mediawiki.git] / maintenance / runJobs.php
blob91168e5967a71a2d031769b033ef0d48c06e1c26
1 <?php
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'];
11 } else {
12 $maxJobs = 10000;
15 $wgTitle = Title::newFromText( 'RunJobs.php' );
17 $dbw = wfGetDB( DB_MASTER );
18 $n = 0;
19 while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) {
20 $offset=0;
21 while ( false != ($job = Job::pop($offset)) ) {
22 wfWaitForSlaves( 5 );
23 print $job->id . " " . $job->toString() . "\n";
24 $offset=$job->id;
25 if ( !$job->run() ) {
26 print "Error: {$job->error}\n";
28 if ( $maxJobs && ++$n > $maxJobs ) {
29 break 2;