MediaWiki master
rebuildall.php
Go to the documentation of this file.
1<?php
25// @codeCoverageIgnoreStart
26require_once __DIR__ . '/Maintenance.php';
27// @codeCoverageIgnoreEnd
28
34class RebuildAll extends Maintenance {
35 public function __construct() {
36 parent::__construct();
37 $this->addDescription( 'Rebuild links, text index and recent changes' );
38 }
39
40 public function getDbType() {
42 }
43
44 public function execute() {
45 // Rebuild the text index
46 if ( $this->getReplicaDB()->getType() != 'postgres' ) {
47 $this->output( "** Rebuilding fulltext search index (if you abort "
48 . "this will break searching; run this script again to fix):\n" );
49 $rebuildText = $this->runChild( RebuildTextIndex::class, 'rebuildtextindex.php' );
50 $rebuildText->execute();
51 }
52
53 // Rebuild RC
54 $this->output( "\n\n** Rebuilding recentchanges table:\n" );
55 $rebuildRC = $this->runChild( RebuildRecentchanges::class, 'rebuildrecentchanges.php' );
56 $rebuildRC->execute();
57
58 // Rebuild link tables
59 $this->output( "\n\n** Rebuilding links tables -- this can take a long time. "
60 . "It should be safe to abort via ctrl+C if you get bored.\n" );
61 $rebuildLinks = $this->runChild( RefreshLinks::class, 'refreshLinks.php' );
62 $rebuildLinks->execute();
63
64 $this->output( "Done.\n" );
65 }
66}
67
68// @codeCoverageIgnoreStart
69$maintClass = RebuildAll::class;
70require_once RUN_MAINTENANCE_IF_MAIN;
71// @codeCoverageIgnoreEnd
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
runChild( $maintClass, $classFile=null)
Returns an instance of the given maintenance script, with all of the current arguments passed to it.
addDescription( $text)
Set the description text.
Maintenance script that rebuilds link tracking tables from scratch.
__construct()
Default constructor.
execute()
Do the actual work.
getDbType()
Does the script need different DB access? By default, we give Maintenance scripts normal rights to th...
$maintClass