aboutsummaryrefslogtreecommitdiffstats
path: root/includes/deferred/LinksUpdate
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/jobqueueJames D. Forrester2025-03-205-6/+6
| | | | | Bug: T353458 Change-Id: I95690a312e356c45dbeed607d32fb0e4626690cf
* 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-175-27/+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-162-12/+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
* 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
* 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
* 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
* 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-271-1/+1
|/ | | | | 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
* 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
* Use expression builder instead of raw sqlUmherirrender2024-07-231-1/+1
| | | | | Bug: T361023 Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
* Replace User, Title, and WikiPage in more signaturesDaimona Eaytoy2024-07-101-8/+11
| | | | Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
* 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
* | 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
* 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-192-2/+2
| | | | Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
* Merge "Namespace includes/cache"jenkins-bot2024-02-281-1/+1
|\
| * Namespace includes/cacheJames D. Forrester2024-02-201-1/+1
| | | | | | | | | | Bug: T353458 Change-Id: Ic3f3168ef17113f5fb3ec11e0a47f52d65eefba9
* | ParserOutput::setPageProperty(): Update documentationC. Scott Ananian2024-02-201-1/+1
|/ | | | | | | | | | String and non-string values behave very differently when passed to ::setPageProperty(), resulting in some unexpected gotchas for the unaware caller. Bug: T350224 Bug: T305158 Change-Id: I23b35b250f27a117d1353ea8a26d2b3f77c568e7
* Merge "LinksUpdate: Replace the deprecated function wfGetDB with ↵jenkins-bot2024-01-231-1/+5
|\ | | | | | | IConnectionProvider"
| * LinksUpdate: Replace the deprecated function wfGetDB with IConnectionProviderDoğu Abaris2024-01-231-1/+5
| | | | | | | | Change-Id: I432151384f69dcb33671fd6b4c257960e294ef52
* | Merge "Change more uses of getDBLoadBalancerFactory() to ↵jenkins-bot2024-01-231-2/+2
|\ \ | |/ |/| | | getConnectionProvider()"
| * Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | Some less trivial cases. Also update variable names. 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: I6657d783375fac5c7fa856b884ff1fb09285e94c
* | Remove more indirect calls to IDBAccessObject::READ_* constantsAmir Sarabadani2024-01-231-1/+2
|/ | | | | | | | | | Found via (?<!IDBAccessObject)::READ_ We are planning to deprecate and remove implementing IDBAccessObject interface just to use the constants. Bug: T354194 Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
* Replace more instances of deprecated MWExceptionDaimona Eaytoy2024-01-192-5/+0
| | | | | Bug: T328220 Change-Id: Iba90f7f9b5766bccc05380d040138d74d5e9558a
* Namespace ParserOutputJames D. Forrester2023-12-1412-12/+12
| | | | | | | Most used non-namespaced class! Bug: T353458 Change-Id: I4c2cbb0a808b3881a4d6ca489eee5d8c8ebf26cf
* Namespace remaining files under includes/deferredJames D. Forrester2023-11-222-5/+5
| | | | | Bug: T166010 Change-Id: Ibd40734b96fd2900e3ce12239d09becfb4150059
* LinksUpdate: Compare raw domain and path for externallinks tableUmherirrender2023-11-141-27/+39
| | | | | | | | | | | | | | | Using LinkFilter functions can repair some values, but that would never removes invalid values from the externallinks table. When LinkFilter get bug fixes on how to handle domain or path there is no way to refresh the links on the externallinks table (even not with refreshlinks.php) as it compares the url rebuilded from the database with the value from the parser. But rebuilding the url from database must not match, when reversing the url to find back the database row. Just use the raw values internally. Bug: T350476 Change-Id: I60e61c229c6923427585a445a08e6130d265519d
* Hard-deprecate ParserOutput::getCategories(), deprecated in 1.40C. Scott Ananian2023-09-291-4/+4
| | | | | | | | | | | | | | | | | | | | | It is difficult to distinguish this method from OutputPage::addJsConfigVars() in code search: https://codesearch.wmcloud.org/deployed/?q=%5BOo%5Dut%28put%29%3F%28%5C%28%5C%29%29%3F-%3EgetCategories%5C%28&files=&excludeFiles=&repos= We generally try to replace $output with $parserOutput or $pOutput as we touch code to improve the ability of codesearch to dig up deprecated ParserOutput methods. Bug: T305161 Depends-On: I02dd4f61c43c225b0ef6dc51c3e4f9d967a0a272 Depends-On: I61d2d77591579d825ad9d37f902e40366be55dd6 Depends-On: I91155106b7a9e10d3334f95ba4936d02851bfb11 Depends-On: Iaca745c79d9587571af03b23b21d76a6cba0ebf1 Depends-On: Id10a171c44411b1233ee4d6cf8fbd3dc57744eef Depends-On: I47a25c011d9bd4b1a15dda4e673e32c25eb64f2b Depends-On: I683fc768aba50b801f46467fcfa1668fa8731ea6 Change-Id: I5a2ac1c99b8b199102e12f0d32dd6ec5cdc24054
* DerivedPageDataUpdater: Only do RefreshLinks on file page redirect changesBartosz Dziewo?ski2023-09-261-3/+14
| | | | | | | | | | | | | | Previously, we scheduled recursive RefreshLinks jobs on every file page edit, but it's only necessary when the page's redirect target has changed. Optimize this, and only schedule them when the page is or was a redirect. (We still do it unnecessarily when a redirect page is edited without changing the target, but that's more difficult to detect at this point.) Bug: T346383 Change-Id: Ie629881c94a7a81ae7bf597aab4587921d1c25ae
* LinksUpdate: Remove deprecated public propertiesBartosz Dziewoński2023-09-261-76/+0
| | | | | | | | | Deprecated in e5a7f8f5aac8af7cf6d7cf4f5928c23126e0e7ed. No errors logged in WMF production, and no obvious uses in Codesearch (although some, like mId and mTitle, are difficult to search for). Change-Id: Ib8f2f9e6c073d2e9244ed3579f4e68a45d5a0711
* Namespace Config-related classes under \MediaWiki\ConfigJames D. Forrester2023-09-212-2/+2
| | | | | Bug: T166010 Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
* Migrate another major batch to SelectQueryBuilderAmir Sarabadani2023-09-201-6/+5
| | | | | | | | I fixed some edge cases in the script that migrates to SQB and it managed to fix these now. Bug: T344971 Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
* Namespace NamespaceInfo under \MediaWiki\TitleJames D. Forrester2023-09-191-1/+1
| | | | | | | One of the big ones, so doing this alone. Bug: T166010 Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
* Remove ParserOutput::{get,unset,set}Property and ::getProperties()C. Scott Ananian2023-09-181-1/+1
| | | | | | | | | | These were deprecated in 1.38 and replaced with ::{get,set}PageProperty() and ::getPageProperties(), avoiding a heavily-aliased use of the term "property" and making the relationship between the ParserOutput and page properties clearer. Bug: T305161 Change-Id: Ib1a5d0a2c1387584b81c958fa32516034e7b3d05
* In query builders, use insertInto() and deleteFrom() instead of insert() and ↵Tim Starling2023-09-082-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for write both for pagelinksAmir Sarabadani2023-09-062-1/+29
| | | | | Bug: T345669 Change-Id: Ia099d092461aa12fc1bfac10c65cf79b391bafca
* ExternalLinks: Drop migration codeAmir Sarabadani2023-09-052-54/+14
| | | | | | | Anything that writes or reads from now-dropped columns Bug: T312666 Change-Id: Ic1c69de717bfa03bba94e97dabad9e717ba13fd6
* LinksTable: pass insert optionsDavid Causse2023-08-091-0/+1
| | | | | | Seems to cause failures otherwise and prevent LinksUpdate to complete. Change-Id: Ib46eb935b9131f5a6480fcd5318b3a0068de620a
* Mass migrate Database::insert calls to InsertQueryBuilderAmir Sarabadani2023-08-071-1/+4
| | | | | | | Done automatically based on a php parser written on top of ANTLR4 Bug: T335377 Change-Id: Ie8fabc594edab18e55cb1d5bbf573762106e3d71
* rdbms: Remove or move unused public methods of ILB/ILBFAmir Sarabadani2023-08-012-14/+6
| | | | | | | | | | | | | | | | | | These methods are either: - Completely unused, removed - Used only by the class itself, made private - Used by LBF (ILB methods) which they were moved to ILoadBalancerForOwner In the meantime, completely deprecating and removing per-domain and per-cluster waitForReplication. Simply wait for all LBs to catch up: * In reality, the replication lag is so small that it doesn't matter. It's probably caught up already by that point anyway. * If you don't make a db call, you don't init a new LBF to be waited on so it's already quite small. Bug: T326274 Change-Id: I2c0a89d70152de56d35290f2666b6699822ed330
* ExternalLinks: Add support for WRITE_NEW only modeAmir Sarabadani2023-07-251-3/+28
| | | | | | | This can be only enabled once I0d60742b6ce is deployed Bug: T341828 Change-Id: I422b6799de9b9e1dfa6eca96ad711b3e59a5b04a
* Move array destructuring into foreachUmherirrender2023-07-081-2/+1
| | | | Change-Id: I54c98085b21f1fe48ccf575d1b9dd60d3b855c58