Moved file deletion code to a more abstract FileDeleteForm::doDelete
[lhc/web/wiklou.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 * @todo document
6 * @addtogroup Maintenance
7 */
8
9 /** */
10 require_once( "commandLine.inc" );
11
12 #require_once( "rebuildlinks.inc" );
13 require_once( "refreshLinks.inc" );
14 require_once( "rebuildtextindex.inc" );
15 require_once( "rebuildrecentchanges.inc" );
16
17 $dbclass = 'Database' . ucfirst( $wgDBtype ) ;
18 $database = new $dbclass( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
19
20 if ($wgDBtype == 'mysql') {
21 print "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n";
22 dropTextIndex( $database );
23 rebuildTextIndex( $database );
24 createTextIndex( $database );
25 }
26
27 print "\n\n** Rebuilding recentchanges table:\n";
28 rebuildRecentChangesTable();
29
30 # Doesn't work anymore
31 # rebuildLinkTables();
32
33 # Use the slow incomplete one instead. It's designed to work in the background
34 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";
35 refreshLinks( 1 );
36
37 print "Done.\n";
38 exit();
39
40