2 define( "REPORTING_INTERVAL", 50 );
3 define( "PAUSE_INTERVAL", 50 );
5 require_once( "commandLine.inc" );
6 error_reporting( E_ALL
& (~E_NOTICE
) );
10 $start = (int)$argv[2];
15 $res = wfQuery("SELECT max(cur_id) as m FROM cur", DB_READ
);
16 $row = wfFetchObject( $res );
19 print("Refreshing link table. Starting from cur_id $start of $end.\n");
21 # Don't generate TeX PNGs (lack of a sensible current directory causes errors anyway)
22 $wgUser->setOption("math", 3);
24 for ($id = $start; $id <= $end; $id++
) {
25 if ( !($id % REPORTING_INTERVAL
) ) {
29 if ( !($id % PAUSE_INTERVAL
) ) {
33 $wgTitle = Title
::newFromID( $id );
34 if ( is_null( $wgTitle ) ) {
38 $wgArticle = new Article( $wgTitle );
39 $text = $wgArticle->getContent( true );
40 $wgLinkCache = new LinkCache
;
41 @$wgOut->addWikiText( $text );
43 if ( $wgEnablePersistentLC ) {
44 $wgLinkCache->saveToLinkscc( $id, wfStrencode( $wgTitle->getPrefixedDBkey() ) );
47 $linksUpdate = new LinksUpdate( $id, $wgTitle->getPrefixedDBkey() );
48 $linksUpdate->doDumbUpdate();
49 $linksUpdate->fixBrokenLinks();