* Refactored the forking code from runJobs.php to a new class called ForkController...
[lhc/web/wiklou.git] / maintenance / gearman / gearmanRefreshLinks.php
1 <?php
2
3 $optionsWithArgs = array( 'fake-job' );
4
5 require( dirname(__FILE__).'/../commandLine.inc' );
6 require( dirname(__FILE__).'/gearman.inc' );
7
8 if ( !$args ) {
9 $args = array( 'localhost' );
10 }
11 $client = new Net_Gearman_Client( $args );
12
13 $dbr = wfGetDB( DB_SLAVE );
14 $res = $dbr->select( 'page', array( 'page_namespace', 'page_title' ), false, __METHOD__ );
15 foreach ( $res as $row ) {
16 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
17 $params = array(
18 'wiki' => wfWikiID(),
19 'title' => $title->getPrefixedDBkey(),
20 'command' => 'refreshLinks',
21 'params' => false,
22 );
23 $client->mw_job( $params );
24 }
25