aboutsummaryrefslogtreecommitdiffstats
path: root/includes/changes
Commit message (Collapse)AuthorAgeFilesLines
* recentchanges: Move rcfeed/ to includes/recentchanges/RCFeed/Timo Tijhof2024-08-2926-6553/+0
| | | | | | | | | | | | | | | | It is part of the component at https://phabricator.wikimedia.org/tag/mediawiki-recent-changes/ and https://www.mediawiki.org/wiki/Developers/Maintainers and since Ifac20da51f7e809f under the same "Recent changes" doc group. The Maintainers list oddly enough lists only rcfeed and completely forgets the majority of it under /includes/changes (or now, /includes/recentchanges). Bug: T364652 Change-Id: I94e6705672c1e2821bdc726aa7a383d9e7c1f7b5
* recentchanges: Improve docs, fix file headers, fix doc groupsTimo Tijhof2024-08-2215-58/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Create a maintenance script to purge expired rows in recentchangesDreamy Jazz2024-08-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Why: * In the CheckUser extension, a maintenance script named 'purgeOldData.php' purges data from the recentchanges table. * This script is run on WMF production daily to ensure private data is purged. * This should instead be in core, so that the functionality can be used when CheckUser is not installed and also not duplicate existing code used for the job that purges the table. What: * Create purgeRecentChanges.php which purges expired rows in the recentchanges table by running the code in the RecentChangesUpdateJob directly (without using the job queue, as there is no need to do that because we are in a maintenance script context). * Add a test for this maintenance script * Test the purging features of the existing job to ensure that this code is reliable. Bug: T373032 Change-Id: Id32780c00b053d7fec94a00812f8d40a6bf2e40c
* Replace deprecated LogFormatter::newFromRow/newFromEntryUmherirrender2024-07-291-1/+4
| | | | Change-Id: I453ce3148a46fcb9cc5c685cee92274e0cb4f98a
* Merge "RecentChange: Replace use of legacy error arrays"jenkins-bot2024-07-101-4/+23
|\
| * RecentChange: Replace use of legacy error arraysBartosz Dziewoński2024-07-091-4/+23
| | | | | | | | | | | | | | | | | | | | | | Replace uses of soon-to-be-deprecated methods: * ApiBase::errorArrayToStatus * PermissionStatus::toLegacyErrorArray Deprecate and replace uses of: * RecentChange::doMarkPatrolled Change-Id: I2311d1fa3772ba6be378ad6f497ed4c0df9b7aa8
* | Replace User, Title, and WikiPage in more signaturesDaimona Eaytoy2024-07-101-15/+16
|/ | | | Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
* Merge "Add namespace and deprecation alias to WatchedItem"jenkins-bot2024-05-171-0/+1
|\
| * Add namespace and deprecation alias to WatchedItemEbrahim Byagowi2024-05-171-0/+1
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Watchlist to WatchedItem and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: Id2a582b624f21867240def2541c98ce5b1bd12b4
* | Add namespace and deprecation alias to RCFeedEbrahim Byagowi2024-05-171-0/+1
|/ | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\RCFeed to RCFeed and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I2e63e05901a75d8cf8a1e9d874dc916c0a5749a4
* Add namespace and deprecation alias to FormatJsonEbrahim Byagowi2024-05-161-0/+1
| | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Json to FormatJson and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
* Move various job classes to relevant component directoriesTimo Tijhof2024-05-101-0/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: * Remove need to hardcode out-of-component files in various places. Especially for Gerrit queries, this not only reduces effort but also makes these files more likely to show up in the first place. * Clarify component boundaries and ownership, e.g. when filing tasks with a stack trace. * Now rather than later, to avoid need for multiple class renames and aliases when PSR-4 namespaces are applied later (T166010). Background: Similar to how jobs in extensions belong to that extension, the same is true within core. There is a distinction between the JobQueue system, and individual jobs belonging to a specific feature or component, likewise for deferred updates, and special pages. To make a begin with this, I propose moving the job classes to their respective components for cases where component boundaries are already clear. E.g. due to exclusively being queued by that same component, being named/introduced by the same commit, being already documented as such in component descriptions on mediawiki.org. Bug: T364652 Change-Id: I73d6b97c6ca9f5abd29f4277d0f845426aa23bd0
* Merge "Add namespace and deprecation alias to DeprecationHelper"jenkins-bot2024-05-051-0/+1
|\
| * Add namespace and deprecation alias to DeprecationHelperHakan Özdemir2024-05-051-0/+1
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Debug to DeprecationHelper and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I808c6aa7836445feaa7b401624d79d01f2c70322
* | Merge "Migrate to IReadableDatabase::newSelectQueryBuilder with queryInfo"jenkins-bot2024-05-051-3/+5
|\ \ | |/ |/|
| * Migrate to IReadableDatabase::newSelectQueryBuilder with queryInfoUmherirrender2024-05-041-3/+5
| | | | | | | | | | | | | | | | | | | | | | This is using SelectQueryBuilder::queryInfo to interact with legacy code In the long term this needs refactor to get a SelectQueryBuilder from the class instead of a query info array. Bug: T344971 Depends-On: I5dff80a2819bba4e923654ef31816a54269354b3 Change-Id: Ibf44e7de30e71fe8dd6447f77dfd0bf726be0a9b
* | Update documentation for rc_newSamwalton92024-05-041-1/+1
| | | | | | | | | | | | | | Per the recentchanges table documentation, rc_new should be replaced with rc_source, which replaced rc_type. Bug: T36320 Change-Id: Ie89e29b2363f36fe6080816c65d96394f6817fd9
* | Formally deprecate code marked with @deprecatedJames D. Forrester2024-05-031-1/+1
|/ | | | | | | | | | | | | | | Some of these have been marked in-code as deprecated for a long while, but haven't ever been announced in the RELEASE-NOTES (and later, HISTORY) file, so let's mark them up now so we can get the ball rolling at least. Per Gergo, the AuthManager one was 'born deprecated' and should only have been used by humans also reading the deprecation notice given in the code, and indeed no uses are known to code search, so also emit deprecation warnings there immediately; others will have to wait until uses have been migrated. Change-Id: I0c1c71d8f4293623039302da35d58d2a24367e97
* Special:NewPages should generate markup consistent with other pager pagesJon Robson2024-04-171-5/+9
| | | | | | | | | | | This will allow us to style NewPages consistent with other Minerva special pages. Update getStartBody and getEndBody to be consistent with ContribsPager, now that the output of the UL is output by mGroupByDate Bug: T360843 Change-Id: I3424d8f4f7a40ff60827065e83532315ba35dfd3
* Merge "RecentChange: Avoid duplicate patrol log entry after patrol conflict"jenkins-bot2024-03-021-5/+23
|\
| * RecentChange: Avoid duplicate patrol log entry after patrol conflictxiplus2024-03-021-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Check the affected rows count to detect a patrol conflict, which is when the database query succeeds, but it was a no-op because another request (possibly from the same user, or someone else) marked it as patrolled already. We detect it using the `rc_patrolled` condition because without it, affectedRows() would always return 1, as the previous update condition could match either the patrolled or patrolled version of the row. Bug: T196182 Change-Id: I2aa4f2f752a40657883e0a6714dbb175c9d2fdcb
* | Namespace includes/cacheJames D. Forrester2024-02-201-0/+1
| | | | | | | | | | Bug: T353458 Change-Id: Ic3f3168ef17113f5fb3ec11e0a47f52d65eefba9
* | Replace last remaining wfGetDB() calls in core, except ResourceLoaderJames D. Forrester2024-02-141-1/+4
| | | | | | | | | | Bug: T330641 Change-Id: I6d30af6ff9f667e367d39befb80c2bb0bf5fb29e
* | Move away from wfGetDB() callsAmir Sarabadani2024-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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-084-0/+6
| | | | | | | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* | ChangesList: Switch from mixed Xml and Html classes to pure Html onesJames D. Forrester2024-02-052-2/+2
| | | | | | | | | | Bug: T356544 Change-Id: Ic7c32515357610bd89d0e3965107d89a3d01f3f4
* | Avoid misnesting div in span in OldChangesListArlo Breault2024-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | When OldChangesList is used, the mw-changeslist-line-inner that the mw-changeslist-links is nested in is a span. mw-changeslist-links is formatted as inline-block in skinStyles.less as it is. Bug: T275230 Change-Id: If97aa95472a73fce1f73c65dfcad961d24cf7e37
* | Replace more instances of unchecked MWExceptionDaimona Eaytoy2024-01-231-2/+1
| | | | | | | | | | | | | | | | Most (all?) of the remaining usages are caught somewhere and will be migrated later. Bug: T328220 Change-Id: I5c36693a5361dd75b4f1e7a0bab5ad48626ed75c
* | 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
* | Change uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-221-6/+6
|/ | | | | | | | | | | | 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 deprecated MWException with InvalidArgumentExceptionDogu2024-01-071-2/+2
| | | | Change-Id: I14391c156f66e9686f82b93d55e0bbcd951f8057
* Consolidate duplicate branch in 'switch' statementDogu2024-01-041-3/+1
| | | | | | | | Merged duplicate branches in the switch statement related to the RecentChange::SRC_NEW case, combining them with existing cases for RecentChange::SRC_EDIT and RecentChange::SRC_CATEGORIZE. Change-Id: If09288dcfdf40b4cf095a568eacac3621956e063
* Inline once-called short private methods to its caller, part 1Amir Sarabadani2023-12-182-24/+3
| | | | | | | | | This makes the code easier to read to avoid jumps and improves encapsulation by not allowing the rest of the class having access to the logic. Of course, if needed then some code can be refactored out again but for now let's not do YAGNI. Change-Id: Ic37524e386fc04fd67e33768417ff8425f85b0ca
* 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-201-3/+3
| | | | | | | | | | | | | | | | | 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
* Migrate to IConnectionProvider methods in more placesAmir Sarabadani2023-10-055-11/+11
| | | | | | | | Getting rid of uber-deprecated wfGetDb() and recently deprecated LB::getConnection. Bug: T330641 Change-Id: Ifd4b4e01f2a120ad6db517cc8fd2eb6b11b72bc9
* Drop RecentChange::getPerformer(), deprecated since 1.36James D. Forrester2023-09-271-16/+0
| | | | Change-Id: I10cd61f6088da3069d7e29e5fe4355747e83236e
* Bump codesniffer to 42.0.0Amir Sarabadani2023-09-272-3/+3
| | | | | | Most noisily, this enables MediaWiki.Arrays.OneSpaceInlineArray. Change-Id: I8ab11399c67ce7e3ab1b6249b591452774393428
* Namespace Config-related classes under \MediaWiki\ConfigJames D. Forrester2023-09-211-0/+1
| | | | | Bug: T166010 Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
* Namespace Sanitizer under \MediaWiki\ParserJames D. Forrester2023-09-213-0/+3
| | | | | Bug: T166010 Change-Id: Id13dcbf7a0372017495958dbc4f601f40c122508
* Namespace remaining User-related classes under \MediaWiki\UserJames D. Forrester2023-09-201-0/+1
| | | | | Bug: T166010 Change-Id: Ibda1e8be0f23c6262a32b607f8260cad36f188fc
* Namespace User under \MediaWiki\UserJames D. Forrester2023-09-197-4/+7
| | | | | Bug: T166010 Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
* Namespace remaining 'specialpage' files under \MediaWiki\SpecialPageJames D. Forrester2023-09-187-0/+7
| | | | | | | SpecialPageFactory is already here, but none of the others were yet. Bug: T166010 Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
* Namespace 'special' Pagers under \MediaWiki\PagerJames D. Forrester2023-09-181-0/+1
| | | | | | | | | | They're under 'specials' because that's where they're mostly used, but they're just another kind of Pager (shown by their use outwith the MediaWiki\Specials hierarchy, which is a bad code smell for us to review later). Bug: T166010 Change-Id: Iad3f91582b723c1e6679525aa852ffdfd8c6d5ba
* Add $wgRequest to phan's globals_type_mapDaimona Eaytoy2023-09-111-2/+0
| | | | | | | | | | | The base phan config uses a file_exists check to determine whether to use the namespaced class name, but it doesn't work when running against core because MW_INSTALL_PATH isn't set. So specify the type in the local config, and remove @phan-var annotations added in I6bbdbbe6. Also use `::class` instead of string literals for classes. Change-Id: I994a0ed32ea948253ed07ee3cc8868a0eaa6d8b9
* Reorg: Move WebRequest to includes\RequestAmir Sarabadani2023-09-111-1/+6
| | | | | | | This has been approved as part of RFC T166010 Bug: T321882 Change-Id: I6bbdbbe6ea48cc1f50bc568bb8780fc7c5361a6f
* Remove redundant empty() constructsDaimona Eaytoy2023-09-081-2/+2
| | | | | | | | | | | | | empty() only makes sense when the expression it checks is possibly undefined, otherwise it's equivalent to a truthiness check with the additional downside of suppressing errors when it's not wanted. Replace it with simple truthiness checks, using strict comparison when that seems to help with polymorphic variables. These were caught by a bespoke phan plugin. Change-Id: I52999e5286a0d9ad70b0da40b41b9f998ecb990e
* In query builders, use insertInto() and deleteFrom() instead of insert() and ↵Tim Starling2023-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | delete() The design principle for SelectQueryBuilder was to make the chained builder calls look as much like SQL as possible, so that developers could leverage their knowledge of SQL to understand what the query builder is doing. That's why SelectQueryBuilder::select() takes a list of fields, and by the same principle, it makes sense for UpdateQueryBuilder::update() to take a table. However with "insert" and "delete", the SQL designers chose to add prepositions "into" and "from", and I think it makes sense to follow that here. In terms of natural language, we update a table, but we don't delete a table, or insert a table. We delete rows from a table, or insert rows into a table. The table is not the object of the verb. So, add insertInto() as an alias for insert(), and add deleteFrom() as an alias for delete(). Use the new methods in MW core callers where PHPStorm knows the type. Change-Id: Idb327a54a57a0fb2288ea067472c1e9727016000
* Migrate calls to wfGetDB() in static methodsAmir Sarabadani2023-09-051-2/+2
| | | | | | | | | | | | | 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
* Merge "ChangesList: Cache user links"jenkins-bot2023-08-241-12/+25
|\