aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/fixInconsistentRedirects.php
Commit message (Collapse)AuthorAgeFilesLines
* add `use MediaWiki\Maintenance\Maintenance` to some maintenance classesNovem Linguae2024-12-041-0/+2
| | | | | | | | | | | | | F–P. Still need to do P–Z. there's a couple spots where I added `use MediaWiki\Maintenance\LoggedUpdateMaintenance;` or similar instead. some of the existing "use" blocks were in weird spots (e.g. above the copyright docblock, or too far down). i didn't move those because they are out of scope for this patch. Change-Id: I5b6a8f3eae5be85d67bccfcce31c0c2027850f45
* Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have bolierplate code that is added before and after the class to allow directly running the maintenance script. * Running the maintenance script directly has been deprecated since 1.40, so this boilerplate code is only to support a now deprecated method of running maintenance scripts. * This code cannot also be marked as covered, due to PHPUnit not recognising code coverage for files. * Therefore, it is best to ignore this boilerplate code in code coverage reports as it cannot be marked as covered and also is for deprecated code. What: * Wrap the boilerplate code (requiring Maintenance.php and then later defining the maintenance script class and running if the maintenance script was called directly) with @codeCoverageIgnore comments. * Some files use a different boilerplate code, however, these should also be marked as ignored for coverage for the same reason that coverage is not properly reported for files. Bug: T371167 Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
* maintenance: Add caller when running query builderUmherirrender2024-05-311-0/+1
| | | | Change-Id: I886306ef047eb3272b6ee9287f49c7b52358c6c7
* maintenance: Introduce getReplicaDB() and getPrimaryDB()Amir Sarabadani2024-01-181-1/+1
| | | | | | | | | | | | And start using them instead of wfGetDB(), LB/LBF connection methods or worse, $this->getDB(). $this->getDB() reuses the database object regardless of whether you're calling a replica or primary, leading to returning a replica on a primary and other way around. Bug: T330641 Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
* installer: Add database updater for 2008/2011 redirect schema changesBartosz Dziewoński2023-09-211-0/+97
In 2008, the `redirect` table was added, and in 2011, it gained the fields `rd_interwiki` and `rd_fragment`. We have never performed proper maintenance for those changes, instead relying on code in WikiPage to update it when the page was visited, or on an optional run of refreshLinks.php. I would like to remove the code in WikiPage, so we probably need to perform this maintenance in the database updater. You know, for the millions of people who have been dutifully upgrading their MediaWiki installations since 2008, but never visited the pages there. The script is a trimmed-down version of refreshLinks.php, without all the weird stuff, and using a better index for the queries. Bug: T346290 Change-Id: Iea251d2737b2fb472c4efb060ad2b97735b4ac53