| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
require_once __DIR__ . '/Maintenance.php'; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
class 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() { |
| 41 |
return Maintenance::DB_ADMIN; |
| 42 |
} |
| 43 |
|
| 44 |
public function execute() { |
| 45 |
|
| 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 |
|
| 54 |
$this->output( "\n\n** Rebuilding recentchanges table:\n" ); |
| 55 |
$rebuildRC = $this->runChild( RebuildRecentchanges::class, 'rebuildrecentchanges.php' ); |
| 56 |
$rebuildRC->execute(); |
| 57 |
|
| 58 |
|
| 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 |
|
| 69 |
$maintClass = RebuildAll::class; |
| 70 |
require_once RUN_MAINTENANCE_IF_MAIN; |
| 71 |
|