aboutsummaryrefslogtreecommitdiffstats
path: root/includes/title/Title.php
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Use expression builder instead of raw sql"jenkins-bot2024-07-261-1/+1
|\
| * Use expression builder instead of raw sqlUmherirrender2024-07-231-1/+1
| | | | | | | | | | Bug: T361023 Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
* | Hard deprecate public access to EditPage::internalAttemptSave()DannyS7122024-07-211-1/+1
|/ | | | | | | | | | | As part of refactoring the edit save logic, remove this public entrypoint - the attemptSave() method is still available. Because the actual logic is still needed by core, we move it to a new private method, internalAttemptSavePrivate(), and call that from the deprecated internalAttemptSave() method. Bug: T157658 Change-Id: I79ccb85f645e15256c4b5867ef3997d10a611e53
* Make Title::getPageViewLanguage() emit deprecation warningsJames D. Forrester2024-07-101-0/+2
| | | | | | | Already unused in production code(?). Follows-Up: Ib130a055e46764544af0f1a46d2bc2b3a7ee85b7 Change-Id: I70932dd45812fd1a52ade92b21d78d8007a7d4fb
* Hard-deprecate Title::flushRestrictionsJames D. Forrester2024-07-101-1/+2
| | | | Change-Id: Icd91ba2c89ad10603ba9f670527a79df0810b1c9
* Hard-deprecate Title::loadRestrictionsJames D. Forrester2024-07-101-1/+2
| | | | Change-Id: I3b5340354076033ef436f757c63a8b81f4bb8ed1
* Hard-deprecate Title::getTitleProtectionJames D. Forrester2024-07-101-1/+3
| | | | Change-Id: I2bfbf428e67263eb4809e33cb78ef5f8bc0273e2
* Replace User, Title, and WikiPage in more signaturesDaimona Eaytoy2024-07-101-10/+0
| | | | Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
* Add "implements Stringable" to every class with "function __toString()"Bartosz Dziewoński2024-06-131-1/+2
| | | | | | | | | | | | | In PHP 8, but not in PHP 7.4, every class with a __toString() function implicitly implements the Stringable interface. Therefore, the behavior of checks like "instanceof Stringable" differs between these PHP versions when such classes are involved. Make every such class implement the interface so that the behavior will be consistent. The PHP 7.4 fallback for the Stringable interface is provided by symfony/polyfill-php80. Change-Id: I3f0330c2555c7d3bf99b654ed3c0b0303e257ea1
* Title: Migrate to IReadableDatabase::newSelectQueryBuilderUmherirrender2024-05-051-20/+11
| | | | | Bug: T344971 Change-Id: I9f57e1437cd613d88361ed7444f273a1fce30eea
* title: Migrate to SelectQueryBuilder in Title::estimateRevisionCountUmherirrender2024-05-041-2/+6
| | | | | Bug: T344971 Change-Id: I2ec925c5420cfbe9c9c1f02a2557f2b3e47ce4fe
* Title: Remove deprecated Title::getCdnUrls(), purgeSquid()Taavi Väänänen2024-05-031-22/+0
| | | | Change-Id: I81614cb101530254ab52473346f8fb6b0f17f48a
* Title: Remove deprecated Title::getBrokenLinksFrom()Taavi Väänänen2024-05-031-29/+0
| | | | Change-Id: I48246a66ce03b018e43128da62ea9e60e457fbf4
* Merge "Use functions of SelectQueryBuilder for STRAIGHT_JOIN / LIMIT"jenkins-bot2024-04-231-6/+3
|\
| * Use functions of SelectQueryBuilder for STRAIGHT_JOIN / LIMITUmherirrender2024-04-151-6/+3
| | | | | | | | Change-Id: I0324f87ebf80f1c97ab162fcef9550fef691674f
* | Title: Add @deprecated tag to getBrokenLinksFrom(), per 25f71099aJames D. Forrester2024-04-151-0/+1
|/ | | | Change-Id: I1f7c95078f3bdbd311b789fd4adeb0c44b3a7f06
* Standardise all our class alias deprecation comments for ease of greppingJames D. Forrester2024-03-191-3/+1
| | | | Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
* Merge "Namespace includes/cache"jenkins-bot2024-02-281-3/+3
|\
| * Namespace includes/cacheJames D. Forrester2024-02-201-3/+3
| | | | | | | | | | Bug: T353458 Change-Id: Ic3f3168ef17113f5fb3ec11e0a47f52d65eefba9
* | Title: be more robust when handling invalid titlesdaniel2024-02-231-8/+30
| | | | | | | | | | | | | | | | | | | | The postcondition in getRootTitle and getBaseTitle was failing when dealing with an invalid title. This patch makes these methods just return the title unchanged when it is invalid, since we cannot expect to parse invalid titles successfully. Bug: T290194 Change-Id: I14d644c42130504055e04cc59d8d7558c93e445d
* | Remove IDBAccessObject from being implemented in many classesAmir Sarabadani2024-02-191-1/+1
|/ | | | | | | | | | | | This is inconsistent with the access pattern of other constants in MediaWiki. it's also confusing (e.g. it's unclear to a newcomer why UserFactory is implementing IDBAccessObject) and it's prone to clashes (e.g. BagOStuff class has a clashing constant). It has been already announced: https://w.wiki/9DAX Bug: T354194 Change-Id: Ic2357634b8385d65b55db2b557191419b06c40e0
* Namespace Message, move to appropriate directoryJames D. Forrester2024-02-141-1/+1
| | | | | Bug: T353458 Change-Id: I088cbc53fbcdb974e5b05b45a62e91709dacc024
* Merge "ParserTestRunner: Fix behavior of bare `parsoid-compatible` file option"jenkins-bot2024-02-121-1/+1
|\
| * ParserTestRunner: Fix behavior of bare `parsoid-compatible` file optionC. Scott Ananian2024-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intent was that a `parsoid-compatible` flag without specified modes would enable all of the parsoid modes. However, the value of `$fileOptions['parsoid-compatible']` in that case is '', and the test was looking specifically for a null or false value, not a falsey one. This exposed a bug where, because the LinkCache was destroyed and reset, the calls to Title::clearCaches() didn't have the expected effect, since the LinkCache held by Title was different from the one held by the PageStore. This caused the wrong page IDs to be associated with titles, which then in turn caused the Disambiguator extension (which looks up page properties by page id) to return the wrong results. Depends-On: Ib65dd0adb472da53823c07af5991a140374501e4 Depends-On: Id9d6b3ab9d168048f46b1ab8783d06a7cbc9e6d4 Change-Id: Ifca13393c3bbec27c23cbdc311d4550fbccf21ca
* | Namespace includes/contextJames D. Forrester2024-02-081-1/+1
| | | | | | | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* | Hard-deprecate Title::getCdnUrlsJames D. Forrester2024-02-071-1/+2
| | | | | | | | | | Depends-On: Ib709a6f7d9d89f3906c5578d25d9036fd326f1c5 Change-Id: I7be53aa758761292a1544bd8273575c7c240abc9
* | Drop six private properties of Title, deprecated in 1.37James D. Forrester2024-01-291-11/+0
| | | | | | | | Change-Id: Ibba09223b763794b31ce7058e8765cc6f4b7f1b4
* | Drop Title::GAID_FOR_UPDATE, deprecated in 1.34James D. Forrester2024-01-291-18/+8
|/ | | | | | | | Depends-On: I7ab9f522cb5f9f874f2762b29e364bff1eef9d98 Depends-On: I23732e29954d3410b22726a524c6e15b71b0d6a1 Depends-On: I8e397e5623cc0291bdf41e815b75022a64fa718c Depends-On: Ib9957de2ef848461252faf39e689478aaabd24b4 Change-Id: Ibbc68f24c14447297308a58e25e545e8a150495b
* Hard-deprecate Title::purgeSquid(), deprecated in 1.35James D. Forrester2024-01-261-1/+2
| | | | | | | Bug: T230025 Depends-On: I80dfaa9ef9d5a3aba009e82da499b250fcf40b06 Depends-On: I8ee3dd63f0c31085ec15426c556d27c95db06395 Change-Id: I9cc839dc57c6ceda0d3a747c8a8fd386de115514
* Merge "Replace deprecated wfGetDB function"jenkins-bot2024-01-231-1/+1
|\
| * Replace deprecated wfGetDB functionDoğu Abaris2024-01-231-1/+1
| | | | | | | | | | | | | | This commit replaces the deprecated function wfGetDB since 1.39 with $this->getDbProvider()->getReplicaDatabase() Change-Id: Ia097b5ebc17ba1f800ba6f1ffd3b5b1eec7e556e
* | 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
* | Merge "Remove more indirect calls to IDBAccessObject::READ_* constants"jenkins-bot2024-01-231-17/+17
|\ \
| * | Remove more indirect calls to IDBAccessObject::READ_* constantsAmir Sarabadani2024-01-231-17/+17
| |/ | | | | | | | | | | | | | | | | | | Found via (?<!IDBAccessObject)::READ_ We are planning to deprecate and remove implementing IDBAccessObject interface just to use the constants. Bug: T354194 Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
* / title: Make TitleArrayFromResult via TitleFactory serviceDerick Alangi2024-01-231-2/+4
|/ | | | | | | | | | | | | | The TitleFactory should really be where TitleArrayFromResult should live as it's a place where Title objects are created based on certain specifications. This patch tries to consolidate the creation of TitleArrayFromResult via the TitleFactory services and in the future, we will consolidate more of the logic and kill TitleArrayFromResult. Follow up on: a99ec1b and e54665d. Change-Id: I98215af3252d756de4435b77d1280dacda8e85dc
* Change uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-221-2/+2
| | | | | | | | | | | | Update cases where one of the IConnectionProvider methods is called immediately. 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: Id0e7d02bab0c570343c2b1f03c70b44ee39db112
* Merge "Introduce DBAccessObjectUtils::getDBFromRecency()"jenkins-bot2024-01-221-2/+5
|\
| * Introduce DBAccessObjectUtils::getDBFromRecency()Amir Sarabadani2024-01-191-2/+5
| | | | | | | | | | | | | | And general clean up of db connection handling in core Bug: T354194 Change-Id: Icb3685f1d7f8d1f4bcadf8e292ddf9450180fcdb
* | Merge "title: Merge largely duplicated Title::getEditNotices code"jenkins-bot2024-01-211-35/+21
|\ \
| * | title: Merge largely duplicated Title::getEditNotices codethiemowmde2024-01-211-35/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was the almost exact same piece of code repeated 3 times, with the only difference being the message key and one of the CSS class names. This duplication is very old. Since commit d894b949 from 2011 the basic logic is repeated 3 times. Since I4ad5e16 from 2015 the Html class is used, which made the duplication much more visible. Change-Id: Ic8201d3a3f38316e566830293c0b4ddbf63f09be
* | | Merge "title: Streamline complex/duplicated code in the Title class"jenkins-bot2024-01-201-30/+22
|\ \ \
| * | | title: Streamline complex/duplicated code in the Title classthiemowmde2024-01-201-30/+22
| |/ / | | | | | | | | | | | | | | | | | | | | | I believe this makes the code quite a bit simpler and more readable and is worth being cleaned up exactly because this is a very critical class. Change-Id: Iaa14075d57093a42ef90240a04e7566d5ac2e7b9
* | | Merge "page: Simplify PageReference::isSamePageAs implementations"jenkins-bot2024-01-201-27/+13
|\ \ \
| * | | page: Simplify PageReference::isSamePageAs implementationsthiemowmde2024-01-201-27/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | I find this code unnecessarily complex when what it does is really simple. It appears like it was written like this in 2020 via I2e0eb21 and later copied to the 2 other places. Also briefly touches Title::equals for the same reason. Change-Id: I2f2e7e1b29c785c250c231295a649458bfe7a4b2
* | / Replace more instances of deprecated MWExceptionDaimona Eaytoy2024-01-191-1/+1
| |/ |/| | | | | | | Bug: T328220 Change-Id: Iba90f7f9b5766bccc05380d040138d74d5e9558a
* | rdbms: Introduce and use SQB::recency to phase out DBAccessObjectUtilsAmir Sarabadani2024-01-111-2/+2
|/ | | | | | | This can slowly simplify and clean up this class. Bug: T354194 Change-Id: I925544ec3107334d40afa42da37be930c25358a8
* Title: Bump page_random updates from ~9% to 10%Lucas Werkmeister2024-01-101-1/+1
| | | | | | | | | Both ends of mt_rand() are inclusive, so mt_rand( 0, 10 ) can return eleven different numbers, not ten. Bug: T309477 Change-Id: Ibab923f7ac13a81bde18e40ac9cca0a428a0e07f Follows-Up: Iab493555c2c343f69a77cc2fb48f5c06407579fc
* Title: Update page_random at random while updating page_touchedAmir Sarabadani2023-12-201-3/+15
| | | | | | | | | | There are research that show page_random is not really random, many options have been considered and simplest mitigation is to update page_random at random while a page is being refreshed. This avoid extra transactions and locking or mass updates that will take a long time. Bug: T309477 Change-Id: Iab493555c2c343f69a77cc2fb48f5c06407579fc
* LinkTarget: extend LinkTarget interface from Parsoid and use LinkTargetTraitC. Scott Ananian2023-11-221-39/+7
| | | | | | | | | | | | | | | | | | | | | | | This ensures that Parsoid and core can communicate using a common interface. By reusing Parsoid's trait it also eliminates code duplication between LinkTarget, Title, and TitleValue. Even though Parsoid's LinkTarget interface is identical to core's, I've elected not to leave an empty LinkTarget interface in core but instead to (re)define the interface methods in order to make core slightly more self-contained and avoid the need for core hackers to consult the Parsoid codebase for the definitions of LinkTarget methods. A small number of types in core were broadened to accept a Parsoid LinkTarget instead of just a core LinkTarget, but these changes should be minimal: only core which directly communicates with Parsoid should need to know about Parsoid's superinterface here. Bug: T296023 Depends-On: Id6ad5ac3b8d1c21c129fa94c10879a1632ed4b47 Depends-On: I59794e98c9881aff3ea6a258bf7d1660a203eb84 Depends-On: Ifc14c0ffc43c7939a6e6b55e00fe2f453fa143a1 Change-Id: I9adc349b230834827b002f412dcc697b44773abe