X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Frebuildall.php;h=dbbed86d256dbc938e5f598ac24f0a07bb9843d7;hb=337b0d3b0f94c74df341e57b6dfe355e09090129;hp=d9ec307c06c0e7f08f9086ff1681ef8a47e791a1;hpb=2ba5e0e71834eb363242f73d0d0977ed6537fa9a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php index d9ec307c06..dbbed86d25 100644 --- a/maintenance/rebuildall.php +++ b/maintenance/rebuildall.php @@ -1,32 +1,55 @@ +/** + * Rebuild link tracking tables from scratch. This takes several + * hours, depending on the database size and server configuration. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @ingroup Maintenance + */ + +require_once( dirname( __FILE__ ) . '/Maintenance.php' ); + +class RebuildAll extends Maintenance { + public function __construct() { + parent::__construct(); + $this->mDescription = "Rebuild links, text index and recent changes"; + } + + public function execute() { + // Rebuild the text index + if ( wfGetDB( DB_SLAVE )->getType() != 'postgres' ) { + $this->output( "** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):\n" ); + $rebuildText = $this->runChild( 'RebuildTextIndex', 'rebuildtextindex.php' ); + $rebuildText->execute(); + } + + // Rebuild RC + $this->output( "\n\n** Rebuilding recentchanges table:\n" ); + $rebuildRC = $this->runChild( 'RebuildRecentchanges', 'rebuildrecentchanges.php' ); + $rebuildRC->execute(); + + // Rebuild link tables + $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" ); + $rebuildLinks = $this->runChild( 'RefreshLinks', 'refreshLinks.php' ); + $rebuildLinks->execute(); + + $this->output( "Done.\n" ); + } +} + +$maintClass = "RebuildAll"; +require_once( RUN_MAINTENANCE_IF_MAIN );