aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryAllDeletedRevisions.php
Commit message (Collapse)AuthorAgeFilesLines
* Avoid constructing Title from LinkTarget where not neededthiemowmde2025-01-241-1/+1
| | | | | | | | | | | | | | I just find this combination of method calls confusing. A revision can not be addressed via a LinkTarget. We can only end having a revision when we started with a proper PageIdentity. This is actually hard-coded in the RevisionRecord constructor. So why not use that PageIdentity when we have the guarantee that it's available? I believe the proposed replacement is also faster. Not only because we avoid calling some extra code. The new code makes sure that the page ID is never lost and doesn't need to be queried again. Change-Id: I3ea3dd8b52566cc9883f3328c7748584fb3d05ff
* 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-16/+1
| | | | | | | Also for all sub-classes Remove simple doc-blocks without further information Change-Id: I981934efe32d44f52e5ab865a9b887be5bd0f41e
* Merge "Use explicit nullable type on parameter arguments"jenkins-bot2024-10-161-1/+1
|\
| * Use explicit nullable type on parameter argumentsUmherirrender2024-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | Implicitly marking parameter $... as nullable is deprecated in php8.4, the explicit nullable type must be used instead Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a Break one long line in SpecialPage.php Bug: T376276 Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
* | Replace uses of deprecated ChangeTags static methodsJames D. Forrester2024-10-161-2/+5
|/ | | | | Bug: T360664 Change-Id: I3363a225e54bb2cae01ba066d432a8b7b21933d2
* Namespace all remaining classes in includes/parserJames D. Forrester2024-10-151-1/+1
| | | | | Bug: T353458 Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
* Add namespace to includes/api classesJames D. Forrester2024-09-251-0/+7
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* rdbms: Create IReadableDatabase::andExpr() / ::orExpr()Umherirrender2024-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | Avoid the call to internal constructor of AndExpressionGroup and OrExpressionGroup by creating a factory function similiar as the IReadableDatabase::expr function for Expression objects. This is also a replacement for calls to ISQLPlatform::makeList with LIST_AND or LIST_OR argument to reduce passing sql as string to the query builders. Created two functions to allow the return type to be set for both expression group to allow further calls of ->and() or ->or() on the returned object. Depending on the length of the array argument to makeList() it is sometimes hard to see if the list gets converted to AND or OR, having the operator in the function name makes it easier to read, so two functions are helpful in this case as well. Bug: T358961 Change-Id: Ica29689cbd0b111b099bb09b20845f85ae4c3376
* api: Rewrite adrto/from/prefix handling to use expression builderUmherirrender2024-06-171-27/+44
| | | | | | | | | | | | | | For a deduplication the raw sql is used as string key in an array. Now only the search term is part of the key, build the sql a bit later, as objects not usable in array keys. The deduplication is needed when namespaces have different first letter configs as happen with $wgCapitalLinks = false for all namespaces except the hard coded like user and mediawiki with talk. Searching for lower case titles splits the query Bug: T361023 Change-Id: Ia4e29d1d4d816f354318ef443ae19c954fd52274
* Migrate several more raw SQL building to expression buildersAmir Sarabadani2024-04-261-1/+1
| | | | | | | | | | Also removing a test from WatchedItemQueryServiceUnitTest. These tests have been written extremely poorly and have caused issue many times over the years not allowing us to do any refactors. There are still pretty good integration tests in place. Bug: T361023 Change-Id: I400294fbbe70ac98508f254a4ed72be14e018975
* 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
* Namespace NamespaceInfo under \MediaWiki\TitleJames D. Forrester2023-09-191-0/+1
| | | | | | | One of the big ones, so doing this alone. Bug: T166010 Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
* 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
* api: Use a temp placeholder for signature on preview/pstUmherirrender2023-05-041-2/+10
| | | | | | | | | | | | | | | For pst on parse/compare/editstash/(all)revisions/(all)deletedrevisions Do not show the IP when IP masking is enabled, instead show a previous aquired temp name or a placeholder on preview. MediaWiki itself used this for the ajax preview on GUI's action=edit Cannot acquire a new unsaved temp user as api parse does not persist the global session (each request results in a new id) and it would require a db write on a read request. Bug: T331397 Change-Id: I74bb4d655f371bd99e3b618d1a0ac45d730c746c
* Api: Fix some very old copyright statements for RoanJames D. Forrester2023-03-161-1/+1
| | | | Change-Id: I820a2d388922653a6a5b9048b0feaafbb4297d91
* 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
* Merge "api: Replace deprecated Linker::formatComment"jenkins-bot2022-12-151-2/+6
|\
| * api: Replace deprecated Linker::formatCommentUmherirrender2022-12-111-2/+6
| | | | | | | | | | Bug: T324906 Change-Id: I1fcb7bd9d84754793c07ac9e39e50c38b364e4c1
* | Fix whitespaces after commaUmherirrender2022-12-151-1/+1
|/ | | | Change-Id: Ide6de0a53661e6f650099d7b1f274a02699441df
* api: Validate timestamp in continue parameterUmherirrender2022-11-011-2/+2
| | | | | Bug: T321265 Change-Id: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
* Deduplicate code for parsing API 'continue' parametersBartosz Dziewoński2022-09-291-24/+11
| | | | | | | | | | | | | | 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-17/+19
| | | | | | | | | | | | | | | | 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
* Do minor code cleanupMatěj Suchánek2022-06-241-1/+0
| | | | | | Remove dead code and fix typos. Should cause no change in behavior. Change-Id: I5d293b842bc93a28b8bcd799a31b5e6e30fe692e
* api: Replace numerous deprecated constantsReedy2022-06-061-9/+10
| | | | Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
* Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-131-2/+3
| | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361
* Replace Content::getParserOutput call to ContentRenderer::getParserOutputRoman Stolar2021-10-201-0/+4
| | | | | Bug: T287158 Change-Id: I8a13f45027e08e2d8ddefa140dd47a0c55094934
* Replace Content::preSaveTransform call to ContentTransformer::preSaveTransformRoman Stolar2021-08-191-2/+6
| | | | | Bug: T287156 Change-Id: I5709441318abc210b3d3beb0be6f2bcbe45ddd36
* api: Inject services into ApiQuery(All)(Deleted)RevisionsUmherirrender2021-07-051-11/+45
| | | | | | | | | | | All classes extending ApiQueryRevisionsBase, for searching: ApiQueryAllRevisions, ApiQueryAllDeletedRevisions ApiQueryRevisions, ApiQueryDeletedRevisions Including services for the ApiQueryRevisionsBase class Bug: T259960 Change-Id: I001a9d39355becacab2e34a00027d04ddf7602b5
* Stop using legacy ActorMigration field "ar_user"Tim Starling2021-04-201-14/+10
| | | | | Bug: T278917 Change-Id: Ib6bdb727d58a1732448a2034732269f2f125be7e
* Use Authority and GroupPermissionLookup in Action APICindy Cicalese2021-02-231-6/+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
* Standardize archive indexesAmir Sarabadani2021-01-281-2/+2
| | | | | | | | | | | | | | | | | For Sqlite and MySQL, renaming name_title_timestamp to ar_name_title_timestamp so it follows the database convention. For Postgres: - Rename archive_name_title_timestamp to ar_name_title_timestamp - Drop archive_actor (that has only ar_actor) - Add ar_actor_timestamp (that has ar_actor, ar_timestamp) This fixes drifts of PG and MySQL and makes work for abstracting the table easier. Bug: T230428 Bug: T164898 Change-Id: I123a4c47602bdd415f0fe5823f96159dcd0d84b8
* Add PHPDoc documentation to all API query module constructorsThiemo Kreuz2020-10-271-0/+4
| | | | Change-Id: I2bc140576efc891bb9b6e50e44041d5bb022ac8f
* API: Use ParamValidator libraryBrad Jorsch2020-02-041-3/+8
| | | | | | | | | | | | | | | | | 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-8/+8
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* Run GenderCache for api query modules using ApiQueryBase::addTitleInfoUmherirrender2019-11-021-0/+5
| | | | | | | | | | | | | | | When converting a Title object into a string for user or user talk namespace the gender information are needed. This patch set improves performance on wikis with gender distinction like dewiki or ruwiki by combining the fetch of the information into one query and avoids a query per unique user name. It also avoids false results for request with apihighlimit, because the apihighlimit with 5000 is higher than the query max limit of the GenderCache with 1000 Bug: T200238 Change-Id: Ibe0561b210dbeb654117dad777e839640f51b4e4
* api: Make ApiQuery(All)DeletedRevisions accessible to everyoneVincent Privat2019-09-091-7/+9
| | | | | | | | Effectively removes the 'deletedhistory' requirement, as this API does not expose more information than the public toolforge database replica. Bug: T232389 Change-Id: I84dc138aa310b601423161d1140891d47f8c64d8
* Use local variabe $services instead of MediaWikiServices::getInstance()Fomafix2019-08-261-1/+1
| | | | Change-Id: Ieb6230231d9b916fd1366e7b473db00c87ac4428
* Deprecate and replace usages of User:isAllowed{All,Any}Petr Pchelko2019-08-211-1/+3
| | | | | Bug: T220191 Change-Id: I197b8fadaa93e7b320fc19c10e3e09387fe09ad2
* Replace User::isAllowed with PermissionManager.Petr Pchelko2019-08-201-1/+1
| | | | | | | | Covers root includes, actions, api, block, changes, changetags, diff and PermissionManager itself. Bug: T220191 Change-Id: Ic027d32f5dd8f4c74865df0c8a9fcf91123c889c
* Remove references to db field ar_text_idBill Pirkle2019-07-091-7/+1
| | | | | | | | | Field ar_text_id is being removed as part of MCR schema changes. Remove references to this field. These references were already unnecessary due to commit 07842be3. Bug: T198341 Change-Id: I3dbf12abf3f67fa0ea07c535e830c9d40b46fdc3
* Mass conversion to NamespaceInfoAryeh Gregor2019-05-071-2/+4
| | | | Change-Id: I2fef157ceec772f304c0923a1cd8c0eef2e82a0f
* Normalize use of "INNER JOIN" to "JOIN" in database queriesAaron Schulz2019-03-061-1/+1
| | | | | | | The ANSI SQL default join type is INNER and this might save some line breaks here and there. Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00
* Use (int) rather than intval()Reedy2019-02-251-2/+2
| | | | | Bug: T216969 Change-Id: I4c06716c83b69d128f26fa7f68736808aa2d3d64
* Merge "Migrate Api modules from tag_summary table to change_tag"jenkins-bot2018-11-301-5/+1
|\
| * Migrate Api modules from tag_summary table to change_tagAmir Sarabadani2018-11-271-5/+1
| | | | | | | | | | Bug: T209525 Change-Id: I7624d86bbff675eab7fee97adf3b7e2e6753f81d
* | Drop $wgChangeTagsSchemaMigrationStageAmir Sarabadani2018-11-281-12/+6
|/ | | | | Bug: T194163 Change-Id: Ieb6cc60cacf9dd0d86641b1be817249cdce42112
* Re-namespace RevisionStore and RevisionRecord classesBrad Jorsch2018-10-091-1/+1
| | | | | | | | | | | | | | | | | | | During development a lot of classes were placed in MediaWiki\Storage\. The precedent set would mean that every class relating to something stored in a database table, plus all related value classes and such, would go into that namespace. Let's put them into MediaWiki\Revision\ instead. Then future classes related to the 'page' table can go into MediaWiki\Page\, future classes related to the 'user' table can go into MediaWiki\User\, and so on. Note I didn't move DerivedPageDataUpdater, PageUpdateException, PageUpdater, or RevisionSlotsUpdate in this patch. If these are kept long-term, they probably belong in MediaWiki\Page\ or MediaWiki\Edit\ instead. Bug: T204158 Change-Id: I16bea8927566a3c73c07e4f4afb3537e05aa04a5
* build: Updating mediawiki/mediawiki-codesniffer to 22.0.0Umherirrender2018-09-161-2/+2
| | | | | | | | | Added spaces around . Removed empty return statement which are not required Removed return after phpunit markTestIncomplete, which is throwing to exit the test, no need for a return Change-Id: I2c80b965ee52ba09949e70ea9e7adfc58a1d89ce