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
43 public function getDbType() {
44 return Maintenance::DB_ADMIN;
45 }
46
47 public function execute() {
48 // Rebuild the text index
49 if ( $this->getReplicaDB()->getType() != 'postgres' ) {
50 $this->output( "** Rebuilding fulltext search index (if you abort "
51 . "this will break searching; run this script again to fix):\n" );
52 $rebuildText = $this->createChild( RebuildTextIndex::class, 'rebuildtextindex.php' );
53 $rebuildText->execute();
54 }
55
56 // Rebuild RC
57 $this->output( "\n\n** Rebuilding recentchanges table:\n" );
58 $rebuildRC = $this->createChild( RebuildRecentchanges::class, 'rebuildrecentchanges.php' );
59 $rebuildRC->execute();
60
61 // Rebuild link tables
62 $this->output( "\n\n** Rebuilding links tables -- this can take a long time. "
63 . "It should be safe to abort via ctrl+C if you get bored.\n" );
64 $rebuildLinks = $this->createChild( RefreshLinks::class, 'refreshLinks.php' );
65 $rebuildLinks->execute();
66
67 $this->output( "Done.\n" );
68 }
69}
70
71// @codeCoverageIgnoreStart
72$maintClass = RebuildAll::class;
73require_once RUN_MAINTENANCE_IF_MAIN;
74// @codeCoverageIgnoreEnd
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
createChild(string $maintClass, ?string $classFile=null)
Returns an instance of the given maintenance script, with all of the current arguments passed to it.
output( $out, $channel=null)
Throw some output to the user.
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