Page MenuHomeMiraheze

fixRC.php

Authored By
RhinosF1
Jan 17 2022, 16:26
Size
786 B
Referenced Files
None
Subscribers
None

fixRC.php

<?php
require_once __DIR__ . '/../../../maintenance/Maintenance.php';
use MediaWiki\MediaWikiServices;
class FixRCDupes extends Maintenance {
public function __construct() {
parent::__construct();
}
/**
* @return bool
*/
public function execute() {
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$dbr = $lbFactory->getMainLB()->getConnection( DB_REPLICA );
$res = $dbr->query('SELECT rc_this_oldid FROM recentchanges GROUP BY rc_this_oldid HAVING COUNT(rc_this_oldid) > 1');
foreach $res as $row {
$dbr->delete(' DELETE from recentchanges where rc_oldid = ' . $res . 'LIMIT 1');
}
}
}
$maintClass = FixRCDupes::class;
require_once RUN_MAINTENANCE_IF_MAIN;

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
85381
Default Alt Text
fixRC.php (786 B)

Event Timeline