aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryLogEvents.php
Commit message (Collapse)AuthorAgeFilesLines
* api: Use type declaration on undocumented private functionsUmherirrender2025-04-041-1/+1
| | | | Change-Id: I2998ad3ccc5a54eccfe36ad09fe509e83dfb719c
* Namespace all remaining files in includes/loggingJames D. Forrester2025-03-191-4/+4
| | | | | 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-10/+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-0/+10
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* Replace deprecated LogFormatter::newFromRow/newFromEntryUmherirrender2024-07-291-2/+6
| | | | Change-Id: I453ce3148a46fcb9cc5c685cee92274e0cb4f98a
* api: Join actor conditionally on list=logeventsUmherirrender2024-04-301-11/+14
| | | | | | When nothing is used from actor, do not add it to the query Change-Id: I7b0095befd4403395a0bf7c0958adbbefa229020
* api: Fix PSR2.Classes.PropertyDeclaration.Multiple errorsTaavi Väänänen2024-04-211-4/+10
| | | | Change-Id: I7859191740d66d00595c4bdeea12b227ac25bcc5
* Add explicit parentheses around mixed boolean operatorUmherirrender2024-03-231-1/+1
| | | | | | | Mixing different binary boolean operators within an expression without using parentheses to clarify precedence is not allowed (T358966) Change-Id: I24ca752d5dac7c948fdbcabf721f6f0aef8a466f
* 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* api: Migrate away from buildLike to expression builderAmir Sarabadani2023-11-081-1/+5
| | | | | | | | Also while we are here, migrate buildComparison() calls with one field only to expr() Bug: T210206 Change-Id: I2ac7adbe4fb26af3383a38106e9a36381148c828
* Use real type hints for services etc. in api/ApiQuery*.phpBartosz Dziewoński2023-08-291-8/+3
| | | | | | | | | | | | | | | 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
* 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
* api: Include associated rev id of log events in list=logeventsUmherirrender2023-02-101-1/+5
| | | | | | For list=recentchanges the revid is already included with rcprop=ids Change-Id: I8ee2eed3bf67f8430df63d9e52346b0749418c2e
* 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
* Merge "api: Replace deprecated Linker::formatComment"jenkins-bot2022-12-151-1/+1
|\
| * api: Replace deprecated Linker::formatCommentUmherirrender2022-12-111-1/+1
| | | | | | | | | | Bug: T324906 Change-Id: I1fcb7bd9d84754793c07ac9e39e50c38b364e4c1
* | Use str_starts_with/str_ends_with/str_containsUmherirrender2022-12-121-1/+1
|/ | | | | | | Use the new function in conditions to avoid creating substrings or to search the whole string Change-Id: Ibad6b1b447a4f62cceb34359231f88ebb967a90b
* api: Validate timestamp in continue parameterUmherirrender2022-11-011-1/+1
| | | | | Bug: T321265 Change-Id: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
* Use short array destructuring instead of list()Tim Starling2022-10-211-1/+1
| | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
* 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-6/+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
* Merge "api: Report external titles in more places as apierror-invalidtitle"jenkins-bot2022-08-051-2/+2
|\
| * api: Report external titles in more places as apierror-invalidtitleUmherirrender2022-04-161-2/+2
| | | | | | | | | | | | It is only useful to use local titles for various api parameters Change-Id: Ife2a951e6b48b59e2b77d455c8343f79f1163b0a
* | Call IContextSource::getAuthority instead of IContextSource::getUserUmherirrender2022-06-291-6/+6
| | | | | | | | | | | | | | Change to use Authority object where possible to use the interface instead of implementation Change-Id: Ia7e9ce2a2f05ef2ae1cf981bf96faf48b04cf58d
* | api: Replace numerous more deprecated constantsReedy2022-06-061-1/+2
| | | | | | | | Change-Id: I498a315b8b4b56d5e2f939e797adbe0487cd7d07
* | api: Replace numerous deprecated constantsReedy2022-06-061-16/+18
| | | | | | | | Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
* | Merge "api: Avoid unneeded page join in list=logevents"jenkins-bot2022-04-211-9/+14
|\ \ | |/ |/|
| * api: Avoid unneeded page join in list=logeventsUmherirrender2022-04-061-9/+14
| | | | | | | | | | | | | | | | | | | | A outer join does not filter the result, when no column is used from the joined table the optimizer just put it away (not part of explain result) That could be done in the code as well to make the query easier to read and understand Bug: T298845 Change-Id: Ibb02b6918f9659122b7235a46ca6cdd69ce26eb8
* | Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-131-5/+6
|/ | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361
* phan: Remove PhanPossiblyUndeclaredVariable suppressionUmherirrender2022-03-301-3/+4
| | | | | | | | | Make phan stricter about conditional variable declaration Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T259172 Change-Id: I1f200ac37df7448453688bf464a8250c97313e5d
* phan: Disable null_casts_as_any_type settingUmherirrender2022-03-211-0/+3
| | | | | | | | | | | Make phan stricter about null types by setting null_casts_as_any_type to false (the default in mediawiki-phan-config) Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T242536 Bug: T301991 Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
* Allow setting max execution time to several special pagesAmir Sarabadani2021-12-151-0/+5
| | | | | | | | | | | | | | | 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-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* api: Inject ChangeTagDefStore into ApiQueryLogEventsUmherirrender2021-07-021-4/+9
| | | | | Bug: T259960 Change-Id: I844306512c307e0e1d01f1de2ac1625daa8ed57d
* Remove logging table index hintAmir Sarabadani2021-06-211-7/+0
| | | | | | | It's not an issue anymore and keeping such hard-coded index is harmful Bug: T270620 Change-Id: I9198c29aa5e773a7521711ce4ef089a208f241ed
* Use array_fill_keys() instead of array_flip() if that reflects the ↵Tim Starling2021-06-151-2/+2
| | | | | | | | | | | | | | | | | | 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
* ApiQueryLogEvents: when user is specified, omit STRAIGHT_JOINTim Starling2021-05-071-1/+2
| | | | | | | | Otherwise it tries to scan the whole logging table, joining every row on actor. Bug: T282122 Change-Id: Ia34897a496656e0d0d26f9e038b1edb0377c461e
* Stop using legacy ActorMigration field "log_user"Tim Starling2021-04-281-18/+8
| | | | | Bug: T278917 Change-Id: I1b78bad7e1fa43f5f82908567a7daad9c6cc79b9
* Inject CommentStore service into api query modulesDannyS7122021-04-231-2/+11
| | | | | | | | | | | | | | - ApiQueryBlocks - ApiQueryDeletedrevs - ApiQueryFilearchive - ApiQueryLogEvents - ApiQueryProtectedTitles - ApiQueryRecentChanges - ApiQueryUserContribs - ApiQueryWatchlist Bug: T259960 Change-Id: Ib7ee815fcea3e72523124eb6a2eaf20ad9565cfe
* Use Authority and GroupPermissionLookup in Action APICindy Cicalese2021-02-231-4/+2
| | | | | | | | | | | | | | | | | | | 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
* Remove unnecessary phan issue suppressionAmmarpad2021-01-081-1/+0
| | | | | | | | Make ApiQueryBase::addOption() annotation consistent with SelectQueryBuilder::option() since the ApiQueryBase method is just a wrapper to it. Change-Id: Ib301bce787c8ba89ae8333eb7cfb8d7d287de20c
* Better handling for Logging index that's being renamedAmmarpad2020-12-291-1/+4
| | | | | Bug: T270769 Change-Id: Iecce3634d61f21695e5f7ea71cba65ddae22d82c
* Reflect name change of logging indexes in codeAmmarpad2020-12-231-1/+1
| | | | | | Bug: T270769 Follow-Up: I17028bba489d04b01d22c39dc8935a4f0f771c7e Change-Id: I9d820dbd315fb793ccdb8b5591240328686a8c2e
* Fix some PHPStorm inspection warnings in includes/apiTim Starling2020-02-181-0/+1
| | | | | | | | | | Notably: * In ApiManageTags, I used a switch instead of a dynamic function name, so that the call graph will be correct. * In ApiImageRotate, checkTitleUserPermissions() has always returned void, this was an error introduced in 4e6810e4a2c1d821d8d108c Change-Id: Iea22616b8e7e2e0cc804619a54f8690898b2cb82
* API: Use ParamValidator libraryBrad Jorsch2020-02-041-3/+4
| | | | | | | | | | | | | | | | | This brings significant modularization to the Action API's parameter validation, and allows the Action API and MW REST API to share validation code. Note there are several changes in this patch that may affect other code; see the entries in RELEASE-NOTES-1.35 for details. Bug: T142080 Bug: T232672 Bug: T21195 Bug: T34675 Bug: T154774 Change-Id: I1462edc1701278760fa695308007006868b249fc Depends-On: I10011be060fe6d27c7527312ad41218786b3f40d
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-101-13/+13
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27