2 define( "REPORTING_INTERVAL", 500 );
4 include_once( "commandLine.inc" );
5 error_reporting( E_ALL
& (~E_NOTICE
) );
9 $start = (int)$argv[2];
14 $res = wfQuery("SELECT max(cur_id) as m FROM cur", DB_READ
);
15 $row = wfFetchObject( $res );
18 print("Refreshing link table. Starting from cur_id $start of $end.\n");
20 $wgUser->setOption("math", 3);
21 for ($id = $start; $id <= $end; $id++
) {
22 if ( !($id % REPORTING_INTERVAL
) ) {
26 $wgTitle = Title
::newFromID( $id );
27 if ( is_null( $wgTitle ) ) {
31 $wgLinkCache = new LinkCache
;
32 $wgArticle = new Article( $wgTitle );
33 $text = $wgArticle->getContent( true );
34 @$wgOut->addWikiText( $text );
36 $linksUpdate = new LinksUpdate( $id, $wgTitle );
37 $linksUpdate->doDumbUpdate();