2024-08-21 15:17:39 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
*/
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2024-08-21 15:17:39 +00:00
|
|
|
require_once __DIR__ . '/Maintenance.php';
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|
2024-08-21 15:17:39 +00:00
|
|
|
|
|
|
|
|
/**
|
recentchanges: Improve docs, fix file headers, fix doc groups
* Define "RecentChanges" doc group and add all classes in changes/
and rcfeed/ to the group, as well as a few obvious classes
that we (currently) maintain in vertical buckets: maintenance,
api, specials.
* Doc group "Change tagging" was invalid because a group identifier
must be a single word, and this was thus passing an unexpected
second argument to the `ingroup` Doxygen command.
As such, it was missing on
https://doc.wikimedia.org/mediawiki-core/master/php/
Define "ChangeTags" properly and fix/add classes in this component.
* Add missing `ingroup` to class blocks (and remove from any file blocks)
as otherwise the file is indexed twice (e.g. in Doxygen) which makes
navigation on doc.wikimedia.org rather messy.
Remove duplicate descriptions from file blocks in favour of class
doc blocks. This reduces needless duplication and was often
incorrect or outdated, and helps make file headers more consistently
(visually) ignorable.
Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged
* Minor improvements to class descriptions here and there.
Test plan:
* `php maintenance/mwdocgen.php --file includes/changes,includes/changetags,includes/rcfeed`
(This will emits harmless warnings about undefined "Hooks" group,
because it's referenced but not included in this fast subset.)
* open docs/html/index.html
Bug: T364652
Change-Id: Ifac20da51f7e809f1a9ccbfac3bf50e739a083ea
2024-08-22 22:30:55 +00:00
|
|
|
* Purge rows from the recentchanges table older than wgRCMaxAge.
|
|
|
|
|
*
|
|
|
|
|
* Useful to run on wikis which are infrequently edited and therefore RecentChangesUpdateJob
|
|
|
|
|
* may not be run frequently enough.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup RecentChanges
|
2024-08-21 15:17:39 +00:00
|
|
|
* @ingroup Maintenance
|
|
|
|
|
* @since 1.43
|
|
|
|
|
*/
|
|
|
|
|
class PurgeRecentChanges extends Maintenance {
|
|
|
|
|
public function __construct() {
|
|
|
|
|
parent::__construct();
|
|
|
|
|
$this->addDescription( 'Purge rows from the recentchanges table which are older than wgRCMaxAge.' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function execute() {
|
|
|
|
|
// Run directly instead of pushing to the job queue, so that the script will exit only once the
|
|
|
|
|
// purge is complete. If a job is already running to do the purge, then the script will exit early.
|
|
|
|
|
// However, this is fine because a purge is already in progress.
|
|
|
|
|
$recentChangesPruneJob = RecentChangesUpdateJob::newPurgeJob();
|
|
|
|
|
$recentChangesPruneJob->run();
|
|
|
|
|
$this->output( "Finished purging data from recentchanges.\n" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2024-08-21 15:17:39 +00:00
|
|
|
$maintClass = PurgeRecentChanges::class;
|
|
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|