aboutsummaryrefslogtreecommitdiffstats
path: root/includes/deferred
Commit message (Collapse)AuthorAgeFilesLines
* CategoryLinksTable: use ParserOutput::getLinkList()C. Scott Ananian2025-04-041-3/+7
| | | | | | | | | We converted most of the LinksUpdate tasks to use ::getLinkList() in I32df68714ffdf2f0745b974f47bc3ccceef1f41c but CategoryLinksTable got overlooked. Follows-Up: I32df68714ffdf2f0745b974f47bc3ccceef1f41c Change-Id: I2953947e2b0a3c05dcba89d798c6b977113c3dc0
* Use type declaration on undocumented private functionsUmherirrender2025-04-022-2/+2
| | | | Change-Id: I0d8d2237500ed6f18439410c902d47c42e4119bc
* Replace a number of uses of class aliases with the real thingsJames D. Forrester2025-03-261-1/+1
| | | | | | | Found via disabling phan's alias support for a run (and ignoring wgLang's hard-coded state of being a \Language, alas). Change-Id: I4753bcd84d72d6de111fc7ffc5841fa417bf7333
* Namespace all remaining files in includes/exceptionJames D. Forrester2025-03-253-4/+4
| | | | | | | | | In MediaWiki/Exception, to follow PSR-4 per plural vs. singular (this can be changed later if people really care). Also, move the couple of exceptions in here that were already namespaced in the MW-top-level into the new space. Bug: T353458 Change-Id: I12ed850ae99effb699a6d7ada173f54e72f0570e
* Namespace all remaining files in includes/jobqueueJames D. Forrester2025-03-209-10/+10
| | | | | Bug: T353458 Change-Id: I95690a312e356c45dbeed607d32fb0e4626690cf
* Fix GREATEST usage in site_statsPppery2025-03-191-7/+4
| | | | | | | | | | For the positive-delta case since the row can't be negative the `GREATEST` is useless, so delete it. For the negative-delta case do the GREATEST before the subtraction so that it doesn't try to temporarily go negative. Bug: T315573 Change-Id: I0a27a57835048ee6a06266d377ed8f3f52ddf435
* Replace call_user_func with dynamic function callUmherirrender2025-02-131-1/+1
| | | | | | | | Use modern php syntax to call a callable. Reduce the stack trace to improve performance and better IDE and static analyzer support Change-Id: I9ef131032a662a3b8db69aa7079dbd51f88f575a
* categorylinks: Add support for write bothAmir Sarabadani2025-01-212-9/+97
| | | | | Bug: T299951 Change-Id: Ifd9876bcb452e412b7335741e74cfc4c820aa248
* Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-176-29/+0
| | | | | | | | | | | | | | | | Same as Ia294bf4 did for 1-line comments. This patch removes slightly more complex 2-line PHPDoc comments that don't add any new information to the code, but literally repeat what the code already says. They say "don't document the code, code the documentation", and we are doing this more and more. We just tend to forget to remove the obsolete comments. Note I'm also removing a line of text in a few cases when it's very short and literally says the same as the method name. Again, such comments add zero new information. Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-164-24/+0
| | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* rdbms: remove MWLBFactory::applyGlobalState deferred update logicAaron Schulz2024-12-191-3/+5
| | | | | | | | | | | | | | | | | | Make the Maintenance transaction wrapper methods directly invoke DeferredUpdates::tryOpportunisticExecute() and flush stats data. This includes the following methods: * Maintenance::commitTransaction() * Maintenance::commitTransactionRound() * Maintenance::waitForReplication() Add explicit DeferredUpdates::tryOpportunisticExecute() calls to integration tests as needed. Deprecate the now-unused IDatabase::setTransactionListener() and ILBFactory::setWaitForReplicationListener(). Bug: T373057 Change-Id: I06488d1826ee97de460cf52117b5d691fa5945ad
* search: Move SearchUpdate.php to /includes/search directoryTimo Tijhof2024-11-261-214/+0
| | | | | | | | | | | | | | | | | | | | The class was introduced for and is exclusively used by the Search component, and is already documented as part of the Search docgroup. It was placed under the deferred directory because, 10+ years ago, we used to treat MediaWiki as something that (mostly) a single team can maintain and look after, but this has changed a lot since then. * Mark the class as internal. I can't think of a use case outside of core, and indeed it has no references outside core (per Codesearch/Everywhere). Follows-up Ibd40734b9, which namespaced this class under Deferred. Remove both the global class alias and the Deferred alias, since the class is now internal and requires no back compat aliases. Bug: T364652 Change-Id: I48937dcda4144e5e039c38a2e336f8361e2d492d
* Use ParserOutput::getLinkList() internallyC. Scott Ananian2024-11-156-11/+49
| | | | | | | | This replaces the internal uses of the deprecated ParserOutput::get* methods and isolates the ParserOutput internal representation from most of the users. Change-Id: I32df68714ffdf2f0745b974f47bc3ccceef1f41c
* language: Move MessageCacheUpdate to languageTimo Tijhof2024-11-141-66/+0
| | | | | | | | | | | | | | | | | * Group the class under the Language doc group, matching the MessageCache class for which MessageCacheUpdate is a utility. * Mark the class as internal. This class was created in 2018 with Ie5e1e83d6740344b7 specifically for use in MessageCache.php. I can't think of a use case outside of that, and indeed it has no references outside this file (per Codesearch/Everywhere). Follows-up Ibd40734b96fd, which namespaced this class under Deferred. Remove both the global class alias and the Deferred alias, since the class is now internal and requires no back compat aliases. Bug: T364652 Change-Id: I3bd99e935c2c9bab8b674d06c388a995ea2c2c07
* Don't hardcode the file extension in searchindex normalizationDerk-Jan Hartman2024-11-061-10/+2
| | | | | | | | | | We don't really have to care what the exact file extension used in the file namespace is and the current list was heavily outdated. This simple regex is a much safer approach. Bug: T366904 Change-Id: I3854e97d9c172b848c37b187e0da3f2d67356d6d
* Rename various $connectionProvider vars to $dbProviderAaron Schulz2024-10-281-3/+3
| | | | | | | This makes it clearer what kind of connections they refer to and is consistent with the vast majority of callers. Change-Id: I2c5499439731b73dad90b78e5ab1069d468fe3d3
* Merge "rdbms: clear replica snapshots in ↵jenkins-bot2024-10-221-4/+0
|\ | | | | | | (begin|commit|rollback)PrimaryChanges()"
| * rdbms: clear replica snapshots in (begin|commit|rollback)PrimaryChanges()Aaron Schulz2024-10-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically perform the empty-transaction commit logic in methods like beginPrimaryChanges() and commitPrimaryChanges(). This avoids the proliferation of callers having to call the same set of methods one after another for non-obvious reasons. It also discourages code from making brittle assumptions that might fail for setups where there is only a primary or the primary has non-zero read load. Deprecate flushReplicaSnapshots() and remove callers. Clarify the related method documentation. Bug: T315664 Change-Id: I255afd22ffcaeac0fad2d4e4a2a0c55c99be7905
* | Use namespaced classesUmherirrender2024-10-211-1/+2
| | | | | | | | | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
* | 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
* | deferred: Add @phan-mandatory-param for function name argumentsUmherirrender2024-10-112-2/+2
|/ | | | | | | | | | Providing the function name is often optional from the php code, but it is needed for better logging, so make it mandatory and let phan report issues about this. Bug: T374546 Follow-Up: I5227f2fa65850ac8c6f620900f22d1f4e7bfd470 Change-Id: I3becd23d3ba9f452a8afd833d509cd907e56ca47
* Merge "Deduplicate language links in ParserOutput and OutputPage"jenkins-bot2024-09-271-1/+2
|\
| * Deduplicate language links in ParserOutput and OutputPageC. Scott Ananian2024-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move deduplication of language links out of Parser.php and into the ParserOutput in order to be compatible with alternate Parsers (Parsoid). Clean up various inconsistencies: ensure deduplication also happens in OutputPage when multiple ParserOutputs are merged into the final output, and ensure that the deduplication in LinksUpdate is done in the same order (first link prevails) as in Parser/ParserOutput/OutputPage. Deprecate OutputPage::setLanguageLinks() (the matching ParserOutput::setLanguageLinks() was deprecated in 1.42). As a breaking change, return an array, not an array *reference*, from ParserOutput::getLanguageLinks(). This allows us to safely modify the internal representation of language links. As far as I can tell, no one used the returned reference to sneakily modify the list of language links, and there not a good way to have deprecated this before making the breaking change. While we're at it, we've added tests to ensure that language link fragments are preserved. Bug: T26502 Bug: T358950 Bug: T375005 Change-Id: I82a05a51d94782ebb9fa87ff889ca0f633b3e15c
* | Add namespace to IDBAccessObject and DBAccessObjectUtilsJames D. Forrester2024-09-272-2/+2
|/ | | | | Bug: T353458 Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
* Add missing documentation to class properties (miscellaneous classes)Umherirrender2024-09-142-0/+4
| | | | | | | | | | 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: I1da4b272a6b28c419cc8e860d142dae19ca0bbcf
* Migrate all uses of deprecated URL global functions to use wfGetUrlUtils()James D. Forrester2024-09-101-1/+1
| | | | | | | | | | | | | | wfGetUrlUtils() is also deprecated, but less so, so we can do this first and then properly replace the individual uses with dependency injection in local pieces of work. Also: * Switching Parser::getExternalLinkRel to UrlUtils::matchesDomainList exposed a type error in media.txt where $wgNoFollowDomainExceptions was set to a string (which is invalid) instead of an array. Bug: T319340 Change-Id: Icb512d7241954ee155b64c57f3782b86acfd9a4c
* Merge "deferred: Hard-deprecate LinksUpdate::getAddedLinks/getRemovedLinks"jenkins-bot2024-08-232-3/+6
|\
| * deferred: Hard-deprecate LinksUpdate::getAddedLinks/getRemovedLinksUmherirrender2024-07-302-3/+6
| | | | | | | | | | | | | | | | | | Also TitleLinksTable::getTitleArray Depends-On: I7bd6714f31a1a3195c1b9a47c9c49b92b9873212 Depends-On: I9514e77a73eea5ee7fbcf4cda79c8f9c4acbd328 Depends-On: I25d047ceb707837009e0a703693ebc2f49fc0ba9 Change-Id: I00b4363b9af7fef3c5a6ae4f612b37c3cd470d45
* | Merge "deferred: remove BIG_QUEUE_SIZE logic that turned updates into jobs"jenkins-bot2024-08-202-62/+1
|\ \
| * | deferred: remove BIG_QUEUE_SIZE logic that turned updates into jobsAaron Schulz2024-08-202-62/+1
| | | | | | | | | | | | | | | | | | | | | There are enough points where tryOpportunisticExecute() is triggered that this no longer needed. Change-Id: Ie27d4ec299df0e6f2754baedc237a473821f0709
* | | Merge "deferred: simplify $dependeeDbws parameter type for MWCallableUpdate"jenkins-bot2024-08-122-3/+3
|\ \ \
| * | | deferred: simplify $dependeeDbws parameter type for MWCallableUpdateAaron Schulz2024-08-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove null type hint and related conditional since it would be silly to bother passing null and nothing is doing so according to code search. Change-Id: I499aebd50433be8fd242461e86f5f9c69b300afe
* | | | Move remaining four classes in includes/content into Content namespaceJames D. Forrester2024-08-101-1/+1
|/ / / | | | | | | | | | | | | Bug: T353458 Change-Id: Ia0f3e22078550be410c4b87faf6aa4eabe6e270d
* | | Merge "deferred: actually flush replica view snapshots in onRunUpdateStart()"jenkins-bot2024-08-091-7/+8
|\ \ \
| * | | deferred: actually flush replica view snapshots in onRunUpdateStart()Aaron Schulz2024-08-081-7/+8
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment mentioned this, but the code did not actually do it. Typically, flushing these does not matter much due to replication lag. However, if a deferred update starts with a replication wait or the prior one ended with a replication wait, then flushing the read transactions can make a reliable difference. Also, if many deferred updates are running in a process, flushing the snapshots means that mysql can purge old versions of rows, since otherwise they could potentially be seen by a future query (e.g. MVCC). Bug: T315664 Change-Id: Ia3ac4193e56ef5b49727457b0cd50dfbc987f881
* / | deferred: pass $fname to MWCallableUpdate callbacks and improve commentsAaron Schulz2024-08-082-14/+35
|/ / | | | | | | | | | | | | | | | | | | This is more convenient for callers since they can avoid the pattern of setting $fname to __METHOD__ and needing $fname in the "use" clause. This is also more consistent with AutoCommitUpdate/AtomicSectionUpdate. Remove @since tags from @internal MWCallableUpdate class. Change-Id: I67c58897dc366a55f43e0a61d56064b26d520c17
* / Use expression builder instead of raw sqlUmherirrender2024-07-232-2/+2
|/ | | | | Bug: T361023 Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
* Replace User, Title, and WikiPage in more signaturesDaimona Eaytoy2024-07-102-14/+17
| | | | Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
* rdbms: Warn about queries that don't provide the callerBartosz Dziewoński2024-05-312-2/+5
| | | | Change-Id: Ib02dac0c607fc9931e1384a9cd7e989db683a4ff
* Use RawSQLValue for some SET clauses in update/upsertUmherirrender2024-05-292-5/+11
| | | | Change-Id: I03c068c4bf098ab073989a0ea32a0f87fe878727
* Merge "Remove TemplateLinksSchemaMigrationStage config"jenkins-bot2024-05-282-23/+6
|\
| * Remove TemplateLinksSchemaMigrationStage configUmherirrender2024-05-152-23/+6
| | | | | | | | | | | | Bug: T299417 Follow-Up: I906e069a63d1dae14924c72318b22b16244371d6 Change-Id: Ia5f730af82f904bd42552e6c6a5c4dadf2454d3a
* | Add namespace and deprecation alias to RefreshSecondaryDataUpdateEbrahim Byagowi2024-05-201-4/+8
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Deferred to RefreshSecondaryDataUpdate and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I9ee3282918f8f3d444a12ca32434a15e93952055
* | Import InvalidArgumentException at top of the sourceEbrahim Byagowi2024-05-193-3/+6
|/ | | | | | | | | | | | | | It was asked in a patch review to apply fully import InvalidArgumentException where possible. I was guessing some of my other already merged patches have but turned out such thing exists other places style so for the sake of consistency I've turned rest of inline import of the specific exception at top of the file. There are instances of source files that aren't in any namespace but have fully qualified import which this patch doesn't touch. Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
* SiteStatsupdate: update to use StatsFactoryCole White2024-05-041-2/+4
| | | | | Bug: T359243 Change-Id: If5f754054e469bdf11dc1446d7f43628dfda65b0
* Stop using LoadBalancer::getConnectionRef() so it can be hard-deprecatedAmir Sarabadani2024-04-301-2/+2
| | | | | Bug: T326274 Change-Id: I90493d7cd4c21fdc022bcc19765fc04d986a9c8f
* search: Use ServiceOptions not full config objectDerick Alangi2024-04-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses the recommended MW practice for injecting settings into MW services. Instead of passing in the full config object, pass in service options which MW service wiring will use to lookup settings/options from config sources. So in this patch, the various options have been identified and put into `CONSTRUCTOR_OPTIONS` constant and inject via service wiring. Test plan ========= Ensure that the special page: `Special:Search` still works with this patch checkout on your local test wiki. When you visit `Special:Search` on your local wiki, you should see a search form view. Type in something like: "Main Page" and then hit search. If everything works well, then local test passes. NOTE ==== This patch also resolves a TODO which mentions the removal of the `getConfig()` method from the SearchEngineConfig class. Change-Id: Ib5dfc10f3f210c6c35247f4f30f9549dd60e0af7
* Substitute category default sort key when filling links table, not at parse timeC. Scott Ananian2024-03-291-0/+10
| | | | | | | | | | | This ensures uniform treatment of all places that call `addCategory` without duplicating the `defaultsort` code; it also ensures that the effect of the {{DEFAULTSORT}} parser function is independent of page position. Bug: T40435 Bug: T353530 Change-Id: I4480a6d59e766fa4eddc9ec9117c58b66771bb47
* Drop old class_aliases for before MW 1.39 that were missedJames D. Forrester2024-03-202-6/+0
| | | | | | | The RandomPage alias was dropped in an earlier commit, so group the release note entry in with these. Change-Id: I207d7463ced1a1bb8b8ac749eba175fc0037a217
* Standardise all our class alias deprecation comments for ease of greppingJames D. Forrester2024-03-1925-25/+25
| | | | Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0