aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/deleteAutoPatrolLogs.php
Commit message (Collapse)AuthorAgeFilesLines
* maintenance: Use type declaration on undocumented private functionsUmherirrender2025-03-311-2/+2
| | | | Change-Id: I2c1bc3b4e0ee782076ddaeae133672b730d345d9
* Namespace all remaining files in includes/loggingJames D. Forrester2025-03-191-0/+1
| | | | | Bug: T353458 Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
* add `use MediaWiki\Maintenance\Maintenance` to some maintenance classesNovem Linguae2024-11-121-0/+2
| | | | | | | A–F. Still need to do F–Z. Bug: T353458 Change-Id: Ieb4bad0658b9cddc9403c6a55ef3bd1245aa08ae
* 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: Introduce getReplicaDB() and getPrimaryDB()Amir Sarabadani2024-01-181-6/+3
| | | | | | | | | | | | 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
* maintenance: Migrate to expression buildersAmir Sarabadani2024-01-171-4/+4
| | | | | | | This was somehow left out Bug: T210206 Change-Id: I70851b5b99fa865dbfd629caf2c1866c85418350
* maintenance: Migrate to DeleteQueryBuilderAmir Sarabadani2024-01-021-5/+4
| | | | | Bug: T353219 Change-Id: Iecb55ab3f905ee9ed4e32e9cbb58c36f8cacf669
* maintenance: Begin using `Maintenance::getServiceContainer()`Derick Alangi2023-09-041-3/+3
| | | | | | | | | | | Maintenance class provides a method for getting a fresh reference of the MW services container instance. Let's make use of these in maintenance scripts now that we have it. NOTE: There are still some static methods like in refreshLinks.php that makes use of services that we can't use this method for now. Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
* maintenance: Use $this->waitForReplication()Amir Sarabadani2022-10-241-2/+1
| | | | | | | This adds reconfiguring db pools in case a replica gets depooled Bug: T298485 Change-Id: Id052ce8ed45c51e51b071778858d27b48605bf93
* maintenance: Use SelectQueryBuilder to construct queriesDerick Alangi2022-07-221-14/+16
| | | | | | | Part 2 of migrating files in `maintenance/` from IDatabase::select() to SelectQueryBuilder. Change-Id: I73eda0e4429016588bcfc6b3b490cb3fc0f5b711
* Convert various callers to LoadBalancer::getConnectionRef()Aaron Schulz2022-02-031-10/+8
| | | | | Bug: T193565 Change-Id: I6dbeac4d5b11ded15263cfedfcae8cba170b5f18
* Explicit order by primary key in DeleteAutoPatrolLogs maintenance scriptUmherirrender2022-01-221-2/+2
| | | | | | | | While most rdbms working with this implicit order, postgres can fail sometimes Bug: T195807 Change-Id: I562a9324d846d8ca3c38914e1704d204db3172f4
* Remove unneeded explicit true/false inside conditionsUmherirrender2021-08-171-1/+1
| | | | | | | | | The non-strict conditions in if/while are true/false without the check. In some situation the true/false is removed, because it is known to be a bool (by is_bool check or type hint) Change-Id: I5ca4c4771af25d2e785e82732df204a73653886e
* Replace uses of DB_MASTER with DB_PRIMARYJames D. Forrester2021-04-291-1/+1
| | | | | | Just an auto-replace from codesniffer for now. Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
* Enable deleteAutoPatrolLogs to delete pre-2011 autopatrol logs as wellAmir Sarabadani2018-05-241-9/+18
| | | | | Bug: T184485 Change-Id: I3f123ea0ae69f80beec7425be0f3e4c00a409c0d
* maintenance: Fix autopatrols typo in deleteAutoPatrolLogsTimo Tijhof2018-04-061-3/+3
| | | | | | Follows-up e1a23c9aad. Change-Id: I43c00b2ac884a80f779be9eead50ad3de6d13fc6
* Add further test cases to deleteAutoPatrolLogsTestMarius Hoch2018-04-031-1/+3
| | | | | | | | Also make --batch-size work and make an if check nicer (makes no functional difference AFAICT). Bug: T189594 Change-Id: I3ce63386cb35441acfa226f313ec8aac1aa417a6
* Introduce deleteAutoPatrolLogs maintenance scriptAmir Sarabadani2018-04-031-0/+196
It's useful to delete old patrol logs that are not useful Bug: T189594 Change-Id: I605bb85f172eb25df45ed83ce50a3d1044f1c281