aboutsummaryrefslogtreecommitdiffstats
path: root/includes/revisiondelete
Commit message (Collapse)AuthorAgeFilesLines
* Replace deprecated LogFormatter::newFromRow/newFromEntryUmherirrender2024-07-293-5/+15
| | | | Change-Id: I453ce3148a46fcb9cc5c685cee92274e0cb4f98a
* Use expression builder instead of raw sqlUmherirrender2024-07-231-1/+1
| | | | | Bug: T361023 Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
* Use RawSQLValue for some SET clauses in update/upsertUmherirrender2024-05-291-10/+12
| | | | Change-Id: I03c068c4bf098ab073989a0ea32a0f87fe878727
* Add MediaWiki\RevisionList namespace to the related classesEbrahim Byagowi2024-05-217-0/+7
| | | | | | | | | This patch introduces a namespace, MediaWiki\RevisionList, and adds it to the related classes and establishes class aliases marked as deprecated since version 1.43. Bug: T353458 Change-Id: I1614a00dd8973c5300d95317a725cbe46e14d1af
* Add namespace and deprecation alias to Xml and XmlSelectEbrahim Byagowi2024-05-162-0/+2
| | | | | | | | | | This patch introduces a new namespace declaration, MediaWiki\Xml and adds Xml and XmlSelect to it and establishes class aliases marked as deprecated since version 1.43. Bug: T353458 Change-Id: I45cccd540b6e15f267d3ab588a064fbeb719d921
* Type hint IReadableDatabase in RevisionListBaseUmherirrender2024-03-142-4/+4
| | | | Change-Id: If4104cc2328a86eb2b588a34426839086c7f6ebb
* Namespace includes/cacheJames D. Forrester2024-02-204-12/+16
| | | | | Bug: T353458 Change-Id: Ic3f3168ef17113f5fb3ec11e0a47f52d65eefba9
* Move away from wfGetDB() callsAmir Sarabadani2024-02-123-4/+14
| | | | | | | | | | | If we are serious about getting rid of wfGetDB(), we should start replcing callers with proper replacement. These classes don't have any injection so it doesn't make sense to introduce it for this specific usecase. Bug: T330641 Change-Id: I645f67324d441288c63787c7e42390b59106c585
* Namespace includes/contextJames D. Forrester2024-02-087-0/+7
| | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* Merge "Change more uses of getDBLoadBalancerFactory() to ↵jenkins-bot2024-01-231-1/+1
|\ | | | | | | getConnectionProvider()"
| * Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | Some less trivial cases. Also update variable names. This doesn't really change anything, but I hope it helps promote getConnectionProvider() as the common way to do this. Follow-up to 8604c384f624273f46b653ec252ffaed30e6ff89. Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
* | Remove more indirect calls to IDBAccessObject::READ_* constantsAmir Sarabadani2024-01-231-2/+1
| | | | | | | | | | | | | | | | | | | | Found via (?<!IDBAccessObject)::READ_ We are planning to deprecate and remove implementing IDBAccessObject interface just to use the constants. Bug: T354194 Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
* | Merge "Replace wfGetDB with IConnectionProvider::getPrimaryDatabase"jenkins-bot2024-01-232-5/+31
|\ \ | |/ |/|
| * Replace wfGetDB with IConnectionProvider::getPrimaryDatabaseDoğu Abaris2024-01-222-5/+31
| | | | | | | | | | | | | | | | | | | | | | This revision updates RevDelArchivedRevisionItem to use the IConnectionProvider::getPrimaryDatabase method instead of wfGetDB, which is deprecated in MediaWiki 1.39. It also adds type hints and annotations for clearer codebase and better maintainability. - Add typing to the getIdField and getId methods. - Improve documentation for constructor and setBits method. Change-Id: Ic914c7afe8bdf0731a1d4f68aeefdfe77b5503ae
* | Change uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-223-3/+3
|/ | | | | | | | | | | | Update cases where one of the IConnectionProvider methods is called immediately. This doesn't really change anything, but I hope it helps promote getConnectionProvider() as the common way to do this. Follow-up to 8604c384f624273f46b653ec252ffaed30e6ff89. Change-Id: Id0e7d02bab0c570343c2b1f03c70b44ee39db112
* Replace more instances of deprecated MWExceptionDaimona Eaytoy2024-01-191-2/+1
| | | | | Bug: T328220 Change-Id: Iba90f7f9b5766bccc05380d040138d74d5e9558a
* Replace more usages of deprecated MWExceptionDaimona Eaytoy2024-01-191-2/+1
| | | | | Bug: T328220 Change-Id: Ie9b56bcf5e962e275d80570cad98d676da505894
* Namespace remaining files under includes/deferredJames D. Forrester2023-11-221-0/+1
| | | | | Bug: T166010 Change-Id: Ibd40734b96fd2900e3ce12239d09becfb4150059
* Migrate off wfGetDB() in more places to ICPAmir Sarabadani2023-11-203-3/+6
| | | | | | | | | | | | | | | | | This function is uber-deprecated, meaning even its replacement is deprecated, We have already migrated in static functions and more. In this batch, all calls have been migrated that there is already a call to MediaWikiServices::getInstance() making the migration easier. Of course in most cases, they should eventually turn into proper service injection but this at least makes it clear what services should be injected. Also removing "category" group since we are removing all groups except a handful from mw (see T263127 for more information). Bug: T330641 Change-Id: I90cd35ee45a37eb6e6bf7a531cc8f75effbd0328
* Mass migrate simple cases to use expression builderAmir Sarabadani2023-10-261-2/+2
| | | | | | | | | | | | | | | Done via '([A-Za-z_\.]+) ?(=|!=|<|<=|>|>=) ?' . (\$db(?:r|w|))->addQuotes\( (.+?) \) to: $3->expr\( '$1', '$2', $4 \) And '([A-Za-z_\.]+) IS NULL OR ([A-Za-z_\.]+) ?(=|!=|<|<=|>|>=) ?' . (\$db(?:r|w|))->addQuotes\( (.+?) \) to: $4->expr( '$1', '=', null )->or\( '$2', '$3', $5 \) Bug: T210206 Change-Id: I109bf2a712bdefa9e074f775b1bee41ac5b9d665
* Introduce ChangeTagsStore::modifyDisplayQueryBuilder()Amir Sarabadani2023-09-273-120/+50
| | | | | | | | To deprecate ::modifyDisplayQuery() and unblock a lot of migrations to SelectQueryBuilder. Bug: T344971 Change-Id: Icb9265644bdbc0b30e2a419ae0103f0e78fe90bd
* Migrate another major batch to SelectQueryBuilderAmir Sarabadani2023-09-201-1/+5
| | | | | | | | I fixed some edge cases in the script that migrates to SQB and it managed to fix these now. Bug: T344971 Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
* Namespace remaining 'specialpage' files under \MediaWiki\SpecialPageJames D. Forrester2023-09-185-0/+5
| | | | | | | SpecialPageFactory is already here, but none of the others were yet. Bug: T166010 Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
* Migrate calls to wfGetDB() in static methodsAmir Sarabadani2023-09-052-7/+10
| | | | | | | | | | | | | wfGetDB() has been deprecated since 1.39 (or more?) and it's better to inject LBF and call ::getReplicaDatabase() or ::getPrimaryDatabase() which is not straightforward in classes but for static functions, there is no way to inject the method so we can simply call MediaWikiServices::getInstance()->getDBLoadBalancerFactory() While I was here, I migrated one call to SelectQueryBuilder. Bug: T330641 Change-Id: Idd2278cef647035dce05a2d461a620e145fe1167
* Reorg: Move Status to MediaWiki\Status\Amir Sarabadani2023-08-255-0/+6
| | | | | | | | | | This class is used heavily basically everywhere, moving it to Utils wouldn't make much sense. Also with this change, we can move StatusValue to MediaWiki\Status as well. Bug: T321882 Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3 Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
* Introduce FileSelectQueryBuilderAmir Sarabadani2023-08-072-24/+14
| | | | | | | So much can be cleaned up with this Bug: T311866 Change-Id: Ia4d46679c540c731b2ae8da2f8022fd6f5b931a4
* Merge "Migrate more calls of Database::select* to SelectQueryBuilder"jenkins-bot2023-07-261-6/+5
|\
| * Migrate more calls of Database::select* to SelectQueryBuilderAmir Sarabadani2023-07-261-6/+5
| | | | | | | | | | | | | | | | | | Using a php parser written on top of ANTLR4, done semi-automatically. I checked everything and made adjustments. Bug: T311866 Change-Id: I6150c6909bce8f3dbd745a26380cc0af9d9c547f
* | Merge "revisiondelete: Use correct rev-del constants in Item/List classes"jenkins-bot2023-07-243-8/+5
|\ \
| * | revisiondelete: Use correct rev-del constants in Item/List classesUmherirrender2023-07-243-8/+5
| |/ | | | | | | | | | | | | Not use RevisionRecord constants for LogPage or File, even the number are the same, the context should be the match Change-Id: Icf50f48fa63144c5ac798e7453faf9cd0a1b706a
* / Turn RevDelList::getSuppressBit() into a constantthiemowmde2023-07-244-21/+10
|/ | | | | | | | Not used anywhere else as a method. It really is just a constant. This goes along with Icf50f48. Can be merged in any order. Change-Id: I8270df212193c10ad35e0b735cca67b2307e535e
* Migrate more usages of Database::update() to UpdateQueryBuilderAlexander Vorwerk2023-06-092-27/+26
| | | | | Bug: T330640 Change-Id: I094eea810886b13d832be575d9b9df8f8e4a77ea
* Clean up UpdateQueryBuilder usageLucas Werkmeister2023-06-084-4/+11
| | | | | | | | | | | | | | | This follows up change I608566700c, which was mainly generated by a script. Most of the clean up here is fixing cases where it seems the script for some reason collapsed multi-line arrays into single-line ones and/or removed spaces after commas. A handful of other improvements are included too (split merged conditions into ->where()->andWhere(), use buildComparison()). In RevDelArchiveItem, a comment is restored that I assume was removed accidentally (perhaps because the script didn’t expect comments inside the conditions). Bug: T330640 Change-Id: If27bafb12fdaa05d3dc1ae6da820e1630ae2742e Follows-Up: I608566700c6d737ee986bf47dda87effc69614d6
* Migrate Database::update() to UpdateQueryBuilderAmir Sarabadani2023-06-085-75/+66
| | | | | | | | I did this using a script written on top of antlr4 parser so it doesn't have some clean ups a human would do but it's pretty nice already. Bug: T330640 Change-Id: I608566700c6d737ee986bf47dda87effc69614d6
* Fix Phan suppressions related to Title::castFrom*() and friendsBartosz Dziewoński2023-04-221-3/+2
| | | | | | | | | | | | | | | | | | | | | There is no way to express that Title::castFromPageIdentity(), Title::castFromPageReference() and Title::castFromLinkTarget() can only return null when the parameter is null. We need to add Phan suppressions or explicit types almost everywhere that these methods are used with parameters that are known to not be null. Instead, introduce new methods Title::newFromPageIdentity() and Title::newFromPageReference() (Title::newFromLinkTarget() already exists), without the null-coalescing behavior, and use them when the parameter is not null. This lets static analysis tools, and humans, easily understand where nulls can't appear. Do the same with the corresponding TitleFactory methods. Change the obvious uses of castFrom*() to newFrom*() (if there is a Phan suppression, a type check, or a method call on the result). Change-Id: Ida4da75953cf3bca372a40dc88022443109ca0cb
* Fix even more PHPStorm inspections (#3)Tim Starling2023-03-255-5/+10
| | | | | | | | | | | | | | | * Inappropriate @inheritDoc usage. Arguably all @inheritDoc is inappropriate but these are the ones PHPStorm flags as misleading due to the method not being inherited. * Doc comment type does not match actual argument/return type. * I replaced "@return void|never" with "@return void" since never means never, it doesn't make sense for it to be conditional. If a method can return (even if that is unlikely) then @return contains the type that it returns. "@return never" means that there is no such type because the method never returns. * Incomplete/partial/broken doc tags Change-Id: Ide86bd6d2b44387f37d234c2b059d6fbc42ec962
* Reorg: Namespace the Title classJames D. Forrester2023-03-026-1/+6
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Switch some simple use of LoadBalancer to use new LBFactory methodsAmir Sarabadani2023-02-232-3/+3
| | | | | Bug: T326274 Change-Id: I837f7a7b0fad4353dbd670eec609fedfd0603af1
* Reorg: Move HTML-related classes out of includes/ to Html/Amir Sarabadani2023-02-161-0/+1
| | | | | Bug: T321882 Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
* revisiondelete: Reuse LogFormatter::getComment instead of own formattingUmherirrender2023-02-091-9/+2
| | | | | | | | | | | Avoid code duplication and allows to use the new styling if Icfb46d9 (T327538) gets merged Remove duplication of span.history-deleted on Special:EditTags - before this change a span.history-deleted element was nested inside another span.history-deleted element and after this change it is not. Change-Id: I2e27bd8e0bcca47a7734fcb6ee28c0d1e6bb5896
* revisiondelete: Replace dynamic property Status::$itemStatusesUmherirrender2023-02-041-3/+3
| | | | | | | Creation of dynamic property Status::$itemStatuses is deprecated Bug: T314099 Change-Id: I5fc1496aa38502143a3511a6a8a110eb9446a2a9
* Replace some usages of MWExceptionDaimona Eaytoy2023-01-261-1/+1
| | | | | | | | These exceptions are not documented with @throws and they're really not meant to be caught. Bug: T86704 Change-Id: I07f32e42c6fd4bc8785bac91547858f15a9fc2a8
* Remove now unused (bogus) cache key in RevDelRevisionListThiemo Kreuz2023-01-113-17/+3
| | | | | | | | | Unused since Idbb5a5a. Note it never worked because of a misplaced } at the end. Bug: T238374 Change-Id: Ic8759a78d02fb5d3d600443445ba5122d512794b
* Split a base class out of CommentStoreAlexander Vorwerk2023-01-012-0/+2
| | | | | | | | | | so that extensions (i.e. CheckUser) can implement their own comment store without having a lot of code duplication basically the comment store version of I3a6486532f2ef36 Bug: T233004 Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
* revisionslists: Replace deprecated Linker::revComment/commentBlockUmherirrender2022-12-112-2/+4
| | | | | Bug: T324906 Change-Id: I0db8521f5ea0266a41687c46d7466a97fbc21742
* Reorg: Move DummyLinker and Linker to linker/Amir Sarabadani2022-12-082-0/+2
| | | | | | | This feels like a no-brainer unless I'm missing something obvious Bug: T321882 Change-Id: Id49c3d0dd6ea4593211048850856b5b8e05a8fb3
* Remove RevDelList::reloadFromMasterMatěj Suchánek2022-11-281-8/+0
| | | | | | It has been deprecated since 1.37 and it is unused. Change-Id: I9f6ff3a656637528ad2f76cbd77e6980737e03c3
* Merge "Sort logging table by timestamp and log id"jenkins-bot2022-10-261-1/+1
|\
| * Sort logging table by timestamp and log idUmherirrender2022-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Sorting on log_id must not give a result in time order, because maintenance scripts can insert newer ids with older timestamps. When only sorting for log_timestamp the result is not stable, because for items with same timestamp the order is not defined. For Special:Log the same timestamp gives problems on pagination Bug: T305590 Change-Id: Ic0c2ebd19ee6a8aa570c5a12a92b31008135491c
* | Use short array destructuring instead of list()Tim Starling2022-10-212-2/+2
|/ | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da