aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryRecentChanges.php
Commit message (Collapse)AuthorAgeFilesLines
* Namespace all remaining files in includes/recentchangesJames D. Forrester2025-03-201-2/+2
| | | | | Bug: T353458 Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
* Namespace all remaining files in includes/loggingJames D. Forrester2025-03-191-3/+3
| | | | | Bug: T353458 Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
* Inject services into API classesFomafix2024-10-281-3/+5
| | | | | | | | | | | | | | | | | Inject all services into the following API classes * ApiQueryAllDeletedRevisions * ApiQueryAllRevisions * ApiQueryDeletedRevisions * ApiQueryDeletedrevs * ApiQueryLogEvents * ApiQueryRecentChanges * ApiQueryRevisions * ApiQuerySiteinfo * ApiQueryUserContribs The classes are not extended by extensions. Change-Id: Iaf3de739f43108976982f5255806e8a1a521dacd
* api: Use type-declaration for string arg in ApiBase::__constructUmherirrender2024-10-171-13/+1
| | | | | | | Also for all sub-classes Remove simple doc-blocks without further information Change-Id: I981934efe32d44f52e5ab865a9b887be5bd0f41e
* Replace uses of deprecated ChangeTags static methodsJames D. Forrester2024-10-161-2/+5
| | | | | Bug: T360664 Change-Id: I3363a225e54bb2cae01ba066d432a8b7b21933d2
* Add namespace to includes/api classesJames D. Forrester2024-09-251-1/+14
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* api: Add missing documentation to class propertiesUmherirrender2024-09-071-0/+1
| | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I8b33b5f4d91c1935228e7010327dbc6ce138fc00
* recentchanges: Improve docs, fix file headers, fix doc groupsTimo Tijhof2024-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Replace deprecated LogFormatter::newFromRow/newFromEntryUmherirrender2024-07-291-2/+6
| | | | Change-Id: I453ce3148a46fcb9cc5c685cee92274e0cb4f98a
* Filter temporary accounts as anonymous in ApiQueryRecentChangesSTran2024-07-291-7/+33
| | | | | | | | | | | | Edits from temporary accounts are considered anonymous edits. ApiQueryRecentChanges doesn't correctly reflect this and needs to be updated to correctly return temporary account edits as anonymous (and similarly, not to return them when requesting !anon) - Update the anon|!anon query to accomodate temporary accounts Bug: T370803 Change-Id: Ica5225422ea53d2aa3a84b86d9c2f14832a34ed4
* Use expression builder instead of raw sqlUmherirrender2024-07-231-11/+11
| | | | | Bug: T361023 Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
* Replace some uses of raw SQL with expression builderBartosz Dziewoński2024-07-071-4/+3
| | | | | | I noticed these while reviewing other changes to the code. Change-Id: If548eb937ba36c94d652ec2f881ce668ea1df21d
* api: Replace ISQLPlatform::makeList in list=recentchangesUmherirrender2024-07-041-4/+6
| | | | | | Use expression builder instead Change-Id: Iba330955dc97eb69aeaf2d45c7c3130f9c1e723d
* api: Fix PSR2.Classes.PropertyDeclaration.Multiple errorsTaavi Väänänen2024-04-211-4/+14
| | | | Change-Id: I7859191740d66d00595c4bdeea12b227ac25bcc5
* Replace more instances of unchecked MWExceptionDaimona Eaytoy2024-01-231-5/+1
| | | | | | | | Most (all?) of the remaining usages are caught somewhere and will be migrated later. Bug: T328220 Change-Id: I5c36693a5361dd75b4f1e7a0bab5ad48626ed75c
* Add `temp` flags to api callsSTran2023-12-121-1/+10
| | | | | | | | | | | | Temporary accounts are now distinct from users or anonymous. Add a flag to reflect that to: - ApiQueryImageInfo - ApiQueryLogEvents - ApiQueryRecentChanges - ApiQueryRevisionsBase Bug: T351636 Change-Id: I7986dea5ccd0dc942bf133040c4ac715487f29b9
* Add 'temp' to allowed user types in various APIsThalia2023-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Before this task, when an API parameter specifies allowed user types, temporary users and permanent users are in the same category: 'name'. * However, it is useful to separate them out, and sometimes allow a permanent user but not a temporary user (e.g. ApiResetPassword, since temporary users don't have passwords). * We therefore re-defined the 'name' type only to refer to permanent (named) users, and add a new 'temp' type. * This fixes params that currently intend to allow temp users, and that use 'name' to do so, by adding 'temp'. What: * Based on a search for `UserDef::PARAM_ALLOWED_USER_TYPES`, add the 'temp' type where necessary. * The following were not updated, because they shouldn't apply to temporary users: - owners for includes/api/ApiQueryWatchlist.php, includes/api/ApiQueryWatchlistRaw.php - users for includes/api/ApiResetPassword.php, includes/api/ApiUserrights.php, includes/api/ApiValidatePassword.php Bug: T350701 Change-Id: If5ccf1d469327791acff74d013343307e411cca9
* Use real type hints for services etc. in api/ApiQuery*.phpBartosz Dziewoński2023-08-291-14/+5
| | | | | | | | | | | | | | | Mostly used find-and-replace: Find: /\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|) Replace with: \3 \1 \4 Followed by some manual review to make sure I'm not changing too much, omitting some changes that looked too complicated and anything that caused test failures, and some whitespace fixes. Change-Id: Ie78be1c614985d7c2964156e454cc9266515dc18
* i18n: Split apihelp for standard dir parameterUmherirrender2023-08-051-0/+4
| | | | | | | | | Easier to translate There is no visible change for example on Special:ApiHelp/query+watchlist Bug: T285545 Change-Id: I536fa3e07a951f3ff98870678ffdbc294a3c7bc0
* Simplify WHERE conditions with field IS NULLUmherirrender2023-07-241-9/+9
| | | | | | Reduce raw sql fragments on simple compares Change-Id: I3f2340dfdbf5197cc22546911e6c5653dc5a6269
* Simplify WHERE conditions with field = '' OR IS NULLUmherirrender2023-07-011-1/+1
| | | | | | Syntax supported since 26235c73 Change-Id: I397c76d4aba753a1629383559b95df86514f19ff
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | 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
* Split a base class out of CommentStoreAlexander Vorwerk2023-01-011-0/+1
| | | | | | | | | | 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
* api: Replace deprecated Linker::formatCommentUmherirrender2022-12-111-1/+1
| | | | | Bug: T324906 Change-Id: I1fcb7bd9d84754793c07ac9e39e50c38b364e4c1
* Merge "api: Do not use rctitle and rcnamespace together"jenkins-bot2022-11-141-2/+4
|\
| * api: Do not use rctitle and rcnamespace togetherUmherirrender2022-11-111-2/+4
| | | | | | | | | | | | | | The sql contains the namespace twice, which is not useful: WHERE rc_namespace = ? AND (rc_namespace = ?) AND rc_title = '?' ) Change-Id: Ia0d50ad70dc4962b888b8baac8fc11be2ba537bb
* | api: Validate timestamp in continue parameterUmherirrender2022-11-011-1/+1
|/ | | | | Bug: T321265 Change-Id: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
* Deduplicate code for parsing API 'continue' parametersBartosz Dziewoński2022-09-291-7/+3
| | | | | | | | | | | | | | 30+ API modules had nearly identical code to split and validate the value of the 'continue' parameter. Introduce the ApiBase::parseContinueParamOrDie() method and use it to replace most usages of ApiBase::dieContinueUsageIf(). A few remain in modules with more complex continuation handling. Inline most single-use variables that remained after validation was moved into the new method. Change-Id: I66bd59ecd4ad16e2039e90f7d66cfa276e6c1c2a
* Use buildComparison() instead of raw SQL in more API modules (easy cases)Bartosz Dziewoński2022-09-291-7/+6
| | | | | | | | | | | | | | | | See ec79aa394312d62b598ad29601e2c80eaaf0dd19 about the new method. These changes all follow the same simple patterns. More complex cases are handled in I6231b6beae13474d4986929367a9adc6bb76b0db. This commit was created by running the following terrible Ruby script I devised: https://phabricator.wikimedia.org/P34833, then manually reviewing the results: checking that the output makes sense in general, that the affected variables are not used elsewhere in the file, and that no comparison conditions have been lost. A few incorrect changes were undone or corrected. Change-Id: I8ed363bd6b80a9481d44434a526f078cce20220f
* api: Minor code cleanupReedy2022-08-141-5/+3
| | | | Change-Id: I1f20597093448d00435158a9ac861873000bb057
* Merge "api: Report external titles in more places as apierror-invalidtitle"jenkins-bot2022-08-051-1/+1
|\
| * api: Report external titles in more places as apierror-invalidtitleUmherirrender2022-04-161-1/+1
| | | | | | | | | | | | It is only useful to use local titles for various api parameters Change-Id: Ife2a951e6b48b59e2b77d455c8343f79f1163b0a
* | api: Replace numerous more deprecated constantsReedy2022-06-061-1/+2
| | | | | | | | Change-Id: I498a315b8b4b56d5e2f939e797adbe0487cd7d07
* | api: Replace numerous deprecated constantsReedy2022-06-061-22/+24
|/ | | | Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
* Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-131-1/+2
| | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361
* Allow setting max execution time to several special pagesAmir Sarabadani2021-12-151-0/+4
| | | | | | | | | | | | | | | These special pages and their counter-part APIs are: - Special:RecentChanges - Special:Watchlist - Special:Log - Special:Contributions This also changes the way MAX_EXECUTION_TIME works from taking the value as milliseconds, it takes seconds which is more intuitive for users. Bug: T297708 Depends-On: I126e7181422d8da1a63afc3717faa4f72a687dd9 Change-Id: I3ff78751c3df3b6342f1865d35c2075f4415185d
* Introduce CommentFormatterTim Starling2021-09-281-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CommentParser: * Move comment formatting backend from Linker to a CommentParser service. Allow link existence and file existence to be batched. * Rename $local to $samePage since I think that is clearer. * Rename $title to $selfLinkTarget since it was unclear what the title was used for. * Rename the "autocomment" concept to "section link" in public interfaces, although the old term remains in CSS classes. * Keep unsafe HTML pass-through in separate "unsafe" methods, for easier static analysis and code review. CommentFormatter: * Add CommentFormatter and RowCommentFormatter services as a usable frontend for comment batches, and to replace the Linker static methods. * Provide fluent and parametric interfaces. Linker: * Remove Linker::makeCommentLink() without deprecation -- nothing calls it and it is obviously an internal helper. * Soft-deprecate Linker methods formatComment(), formatLinksInComment(), commentBlock() and revComment(). Caller migration: * CommentFormatter single: Linker, RollbackAction, ApiComparePages, ApiParse * CommentFormatter parametric batch: ImageHistoryPseudoPager * CommentFormatter fluent batch: ApiQueryFilearchive * RowCommentFormatter sequential: History feed, BlocklistPager, ProtectedPagesPager, ApiQueryProtectedTitles * RowCommentFormatter with index: ChangesFeed, ChangesList, ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges * RevisionCommentBatch: HistoryPager, ContribsPager Bug: T285917 Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
* Drop action api token methods deprecated in 1.24Petr Pchelko2021-09-131-91/+2
| | | | | | | | | | | Removes deprecated API endpoints and modules for dealing with CSRF tokens. Note: i18n messages are removed in a followup for ease of revert. Bug: T280806 Depends-On: Ic83f44587db119ff2e3e6d5ff33a10894e0695e7 Change-Id: I58aedec6942ac5d3c21574cb0072f00ef365098c
* Merge "Revert "Use CsrfTokenSet as CSRF token source""jenkins-bot2021-08-051-3/+1
|\
| * Revert "Use CsrfTokenSet as CSRF token source"Kunal Mehta2021-08-051-3/+1
| | | | | | | | | | | | | | This reverts commit 0d75fdb4f73ddbf4ad5f29e14258d58e507d55b4. Bug: T287542 Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
* | api: list=recentchanges user param must not be an objectUmherirrender2021-08-061-2/+0
|/ | | | | | Avoid implicit User::__toString Change-Id: Ia2d13c7127834b9bc2d59e31c8b231edd66f5e93
* Use CsrfTokenSet as CSRF token sourcePetr Pchelko2021-07-121-1/+3
| | | | Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
* api: Inject services into ApiQueryRecentChangesUmherirrender2021-07-031-8/+24
| | | | | Bug: T259960 Change-Id: Ifab55daae08ee49e07bef93656cb7eb474f46cae
* Use array_fill_keys() instead of array_flip() if that reflects the ↵Tim Starling2021-06-151-3/+3
| | | | | | | | | | | | | | | | | | developer's intention array_fill_keys() was introduced in PHP 5.2.0 and works like array_flip() except that it does only one thing (copying keys) instead of two things (copying keys and values). That makes it faster and more obvious. When array_flip() calls were paired, I left them as is, because that pattern is too cute. I couldn't kill something so cute. Sometimes it was hard to figure out whether the values in array_flip() result were used. That's the point of this change. If you use array_fill_keys(), the intention is obvious. Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
* Stop using legacy ActorMigration field "rc_user"Tim Starling2021-04-281-34/+28
| | | | | Bug: T278917 Change-Id: I4d6c175c637a2cb26c63e0b2b27d5ea8ce6b1e0d
* Inject CommentStore service into api query modulesDannyS7122021-04-231-5/+10
| | | | | | | | | | | | | | - ApiQueryBlocks - ApiQueryDeletedrevs - ApiQueryFilearchive - ApiQueryLogEvents - ApiQueryProtectedTitles - ApiQueryRecentChanges - ApiQueryUserContribs - ApiQueryWatchlist Bug: T259960 Change-Id: Ib7ee815fcea3e72523124eb6a2eaf20ad9565cfe
* Use Authority and GroupPermissionLookup in Action APICindy Cicalese2021-02-231-8/+4
| | | | | | | | | | | | | | | | | | | Replaces calls directly to PermissionManager with calls to the Authority object available from Context or the GroupPermissionLookup service. This patch does not address use of PermissionManager for blocks. Deprecations: - ApiBase::checkUserRightsAny deprecated passing optional User parameter - ApiBase::checkTitleUserPermissions deprecated passing LinkTarget as first parameter, takes PageIdentity instead Bug: T271462 Bug: T271854 Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
* Improve docs in api related classesUmherirrender2020-11-131-1/+1
| | | | Change-Id: I78338d48530f098fa5d36fe84cfd45c0d160f444
* Add PHPDoc documentation to all API query module constructorsThiemo Kreuz2020-10-271-0/+4
| | | | Change-Id: I2bc140576efc891bb9b6e50e44041d5bb022ac8f
* Remove uses of $wgUser in api token methodsDannyS7122020-09-091-14/+13
| | | | | Bug: T243708 Change-Id: I2f82af8c3413038fa321434759dc9e9a921e3118