MediaWiki master
rebuildall.php
Go to the documentation of this file.
1<?php
26
27// @codeCoverageIgnoreStart
28require_once __DIR__ . '/Maintenance.php';
29// @codeCoverageIgnoreEnd
30
36class RebuildAll extends Maintenance {
37 public function __construct() {
38 parent::__construct();
39 $this->addDescription( 'Rebuild links, text index and recent changes' );
40 }
41
42 public function getDbType() {
43 return Maintenance::DB_ADMIN;
44 }
45
46 public function execute() {
47 // Rebuild the text index
48 if ( $this->getReplicaDB()->getType() != 'postgres' ) {
49 $this->output( "** Rebuilding fulltext search index (if you abort "
50 . "this will break searching; run this script again to fix):\n" );
51 $rebuildText = $this->runChild( RebuildTextIndex::class, 'rebuildtextindex.php' );
52 $rebuildText->execute();
53 }
54
55 // Rebuild RC
56 $this->output( "\n\n** Rebuilding recentchanges table:\n" );
57 $rebuildRC = $this->runChild( RebuildRecentchanges::class, 'rebuildrecentchanges.php' );
58 $rebuildRC->execute();
59
60 // Rebuild link tables
61 $this->output( "\n\n** Rebuilding links tables -- this can take a long time. "
62 . "It should be safe to abort via ctrl+C if you get bored.\n" );
63 $rebuildLinks = $this->runChild( RefreshLinks::class, 'refreshLinks.php' );
64 $rebuildLinks->execute();
65
66 $this->output( "Done.\n" );
67 }
68}
69
70// @codeCoverageIgnoreStart
71$maintClass = RebuildAll::class;
72require_once RUN_MAINTENANCE_IF_MAIN;
73// @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