Play safe and clear the article object internals, too (eg. mTouched).
[lhc/web/wiklou.git] / maintenance / rebuildall.php
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 * @ingroup Maintenance
22 */
23
24 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
25
26 class RebuildAll extends Maintenance {
27 public function __construct() {
28 parent::__construct();
29 $this->mDescription = "Rebuild links, text index and recent changes";
30 }
31
32 public function execute() {
33 // Rebuild the text index
34 if ( wfGetDB( DB_SLAVE )->getType() != 'postgres' ) {
35 $this->output( "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n" );
36 $rebuildText = $this->runChild( 'RebuildTextIndex', 'rebuildtextindex.php' );
37 $rebuildText->execute();
38 }
39
40 // Rebuild RC
41 $this->output( "\n\n** Rebuilding recentchanges table:\n" );
42 $rebuildRC = $this->runChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' );
43 $rebuildRC->execute();
44
45 // Rebuild link tables
46 $this->output( "\n\n** Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.\n" );
47 $rebuildLinks = $this->runChild( 'RefreshLinks', 'refreshLinks.php' );
48 $rebuildLinks->execute();
49
50 $this->output( "Done.\n" );
51 }
52 }
53
54 $maintClass = "RebuildAll";
55 require_once( DO_MAINTENANCE );