]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - maintenance/rebuildall.php
MediaWiki 1.15.1
[autoinstallsdev/mediawiki.git] / maintenance / rebuildall.php
1 <?php
2 /**
3  * Rebuild link tracking tables from scratch.  This takes several
4  * hours, depending on the database size and server configuration.
5  *
6  * @file
7  * @todo document
8  * @ingroup Maintenance
9  */
10
11 /** */
12 require_once( "commandLine.inc" );
13
14 #require_once( "rebuildlinks.inc" );
15 require_once( "refreshLinks.inc" );
16 require_once( "rebuildtextindex.inc" );
17 require_once( "rebuildrecentchanges.inc" );
18
19 $dbclass = 'Database' . ucfirst( $wgDBtype ) ;
20 $database = new $dbclass( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
21
22 if ($wgDBtype == 'mysql') {
23         print "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n";
24         dropTextIndex( $database );
25         rebuildTextIndex( $database );
26         createTextIndex( $database );
27 }
28
29 print "\n\n** Rebuilding recentchanges table:\n";
30 rebuildRecentChangesTable();
31
32 # Doesn't work anymore
33 # rebuildLinkTables();
34
35 # Use the slow incomplete one instead. It's designed to work in the background
36 print "\n\n** Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.\n";
37 refreshLinks( 1 );
38
39 print "Done.\n";
40 exit();
41
42