2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2004-09-03 20:33:01 +00:00
|
|
|
/**
|
|
|
|
|
* Rebuild link tracking tables from scratch. This takes several
|
|
|
|
|
* hours, depending on the database size and server configuration.
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
*
|
2009-08-02 19:35:17 +00:00
|
|
|
* 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
|
|
|
|
|
*
|
2012-08-09 16:06:18 +00:00
|
|
|
* @file
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Maintenance
|
2004-09-03 20:33:01 +00:00
|
|
|
*/
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2013-05-17 00:16:59 +00:00
|
|
|
require_once __DIR__ . '/Maintenance.php';
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|
2009-08-02 19:35:17 +00:00
|
|
|
|
2012-08-09 16:06:18 +00:00
|
|
|
/**
|
|
|
|
|
* Maintenance script that rebuilds link tracking tables from scratch.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup Maintenance
|
|
|
|
|
*/
|
2009-08-02 19:35:17 +00:00
|
|
|
class RebuildAll extends Maintenance {
|
|
|
|
|
public function __construct() {
|
|
|
|
|
parent::__construct();
|
2016-01-30 02:48:47 +00:00
|
|
|
$this->addDescription( 'Rebuild links, text index and recent changes' );
|
2009-08-02 19:35:17 +00:00
|
|
|
}
|
|
|
|
|
|
2013-06-25 06:14:20 +00:00
|
|
|
public function getDbType() {
|
|
|
|
|
return Maintenance::DB_ADMIN;
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-02 19:35:17 +00:00
|
|
|
public function execute() {
|
|
|
|
|
// Rebuild the text index
|
2024-01-17 18:53:40 +00:00
|
|
|
if ( $this->getReplicaDB()->getType() != 'postgres' ) {
|
2014-04-22 21:07:08 +00:00
|
|
|
$this->output( "** Rebuilding fulltext search index (if you abort "
|
|
|
|
|
. "this will break searching; run this script again to fix):\n" );
|
2018-01-13 00:02:09 +00:00
|
|
|
$rebuildText = $this->runChild( RebuildTextIndex::class, 'rebuildtextindex.php' );
|
2009-08-02 19:35:17 +00:00
|
|
|
$rebuildText->execute();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Rebuild RC
|
|
|
|
|
$this->output( "\n\n** Rebuilding recentchanges table:\n" );
|
2018-01-13 00:02:09 +00:00
|
|
|
$rebuildRC = $this->runChild( RebuildRecentchanges::class, 'rebuildrecentchanges.php' );
|
2009-08-02 19:35:17 +00:00
|
|
|
$rebuildRC->execute();
|
|
|
|
|
|
|
|
|
|
// Rebuild link tables
|
2014-04-22 21:07:08 +00:00
|
|
|
$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" );
|
2018-01-13 00:02:09 +00:00
|
|
|
$rebuildLinks = $this->runChild( RefreshLinks::class, 'refreshLinks.php' );
|
2009-08-02 19:35:17 +00:00
|
|
|
$rebuildLinks->execute();
|
2010-12-04 03:20:14 +00:00
|
|
|
|
2009-08-02 19:35:17 +00:00
|
|
|
$this->output( "Done.\n" );
|
|
|
|
|
}
|
2008-03-14 04:39:18 +00:00
|
|
|
}
|
2004-08-11 09:02:20 +00:00
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2018-01-13 00:02:09 +00:00
|
|
|
$maintClass = RebuildAll::class;
|
2013-05-07 23:00:15 +00:00
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|