Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
RebuildAll | |
0.00% |
0 / 16 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
getDbType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | /** |
3 | * Rebuild link tracking tables from scratch. This takes several |
4 | * hours, depending on the database size and server configuration. |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License along |
17 | * with this program; if not, write to the Free Software Foundation, Inc., |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
19 | * http://www.gnu.org/copyleft/gpl.html |
20 | * |
21 | * @file |
22 | * @ingroup Maintenance |
23 | */ |
24 | |
25 | // @codeCoverageIgnoreStart |
26 | require_once __DIR__ . '/Maintenance.php'; |
27 | // @codeCoverageIgnoreEnd |
28 | |
29 | /** |
30 | * Maintenance script that rebuilds link tracking tables from scratch. |
31 | * |
32 | * @ingroup Maintenance |
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 | // 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; |
70 | require_once RUN_MAINTENANCE_IF_MAIN; |
71 | // @codeCoverageIgnoreEnd |