aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/refreshLinks.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@users.mediawiki.org>2004-06-15 15:18:50 +0000
committerTim Starling <tstarling@users.mediawiki.org>2004-06-15 15:18:50 +0000
commit2ba5e0e71834eb363242f73d0d0977ed6537fa9a (patch)
treed9ed21ab0d381457ecd8803a383b0096e0f1c0f5 /maintenance/refreshLinks.php
parent498b4d60bd8ced58076ec4c2ac8013fcedc8d283 (diff)
downloadmediawikicore-2ba5e0e71834eb363242f73d0d0977ed6537fa9a.tar.gz
mediawikicore-2ba5e0e71834eb363242f73d0d0977ed6537fa9a.zip
* Moved content from liveCmdLine.inc into commandLine.inc, obsoleting the former.
* Put some option handling code in commandLine.inc which is untested and unused (for the moment). * Converted all existing command line scripts to use the standard header and argument array. * Did a quick test of compressOld.php, rebuildall.php and rebuildMessages.php to check for breakage. * rebuildall.php was broken due to the unmaintained rebuildlinks.php, so I converted it to use refreshLinks instead. Required splitting into refreshLinks.inc and refreshLinks.php
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/4083
Diffstat (limited to 'maintenance/refreshLinks.php')
-rw-r--r--maintenance/refreshLinks.php41
1 files changed, 3 insertions, 38 deletions
diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php
index 089e6a70b5b0..6d6ddc3f0494 100644
--- a/maintenance/refreshLinks.php
+++ b/maintenance/refreshLinks.php
@@ -1,8 +1,8 @@
<?php
-define( "REPORTING_INTERVAL", 50 );
-define( "PAUSE_INTERVAL", 50 );
require_once( "commandLine.inc" );
+require_once( "refreshLinks.inc" );
+
error_reporting( E_ALL & (~E_NOTICE) );
@@ -12,42 +12,7 @@ if ($argv[2]) {
$start = 1;
}
-$res = wfQuery("SELECT max(cur_id) as m FROM cur", DB_READ);
-$row = wfFetchObject( $res );
-$end = $row->m;
-
-print("Refreshing link table. Starting from cur_id $start of $end.\n");
-
-# Don't generate TeX PNGs (lack of a sensible current directory causes errors anyway)
-$wgUser->setOption("math", 3);
-
-for ($id = $start; $id <= $end; $id++) {
- if ( !($id % REPORTING_INTERVAL) ) {
- print "$id\n";
- }
-
- if ( !($id % PAUSE_INTERVAL) ) {
- sleep(1);
- }
-
- $wgTitle = Title::newFromID( $id );
- if ( is_null( $wgTitle ) ) {
- continue;
- }
-
- $wgArticle = new Article( $wgTitle );
- $text = $wgArticle->getContent( true );
- $wgLinkCache = new LinkCache;
- @$wgOut->addWikiText( $text );
-
- if ( $wgEnablePersistentLC ) {
- $wgLinkCache->saveToLinkscc( $id, wfStrencode( $wgTitle->getPrefixedDBkey() ) );
- }
-
- $linksUpdate = new LinksUpdate( $id, $wgTitle->getPrefixedDBkey() );
- $linksUpdate->doDumbUpdate();
- $linksUpdate->fixBrokenLinks();
-}
+refreshLinks( $start );
exit();