3 $optionsWithArgs = array( 'fake-job' );
5 require( dirname( __FILE__
) . '/../commandLine.inc' );
6 require( dirname( __FILE__
) . '/gearman.inc' );
9 $args = array( 'localhost' );
11 $client = new Net_Gearman_Client( $args );
14 $dbr = wfGetDB( DB_SLAVE
);
16 $endId = $dbr->selectField( 'page', 'MAX(page_id)', false, __METHOD__
);
20 array( 'page_namespace', 'page_title', 'page_id' ),
21 array( 'page_id > ' . intval( $startId ) ),
23 array( 'LIMIT' => $batchSize )
26 if ( $res->numRows() == 0 ) {
29 $set = new Net_Gearman_Set
;
30 foreach ( $res as $row ) {
31 $startId = $row->page_id
;
32 $title = Title
::makeTitle( $row->page_namespace
, $row->page_title
);
35 'title' => $title->getPrefixedDBkey(),
36 'command' => 'refreshLinks',
39 $task = new Net_Gearman_Task( 'mw_job', $params );
40 $set->addTask( $task );
42 $client->runSet( $set );
43 print "$startId / $endId\n";