aboutsummaryrefslogtreecommitdiffstats
path: root/includes/import/WikiRevision.php
Commit message (Collapse)AuthorAgeFilesLines
* Replace a number of uses of class aliases with the real thingsJames D. Forrester2025-03-261-0/+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
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-161-3/+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 namespaced classesUmherirrender2024-10-211-0/+1
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
* Add namespace to maintenance/includes classesJames D. Forrester2024-10-091-0/+1
| | | | | | | Also a few other fixes of PHP class aliases spotted by phan. Bug: T353458 Change-Id: Ie79d65722c47c24f8f20f1293355cfd3c2e8c2ad
* docs: Adjust all @deprecated tags to use 'since…' for consistencyJames D. Forrester2024-05-011-1/+1
| | | | | | | | This skips ones that have been marked but were never in the then RELEASE-NOTES and later HISTORY file, and so weren't properly deprecated ever. Change-Id: I31df2d7e83182b5bf9524237fc4a1862356bfd5a
* Update name & email for bvibberBrooke Vibber2024-02-081-1/+1
| | | | | | | | | | | | | Updating name & email addresses for Brooke Vibber. Re-ran updateCredits.php as well so there are some new entries in there as well. There are a couple of files in resources/libs that will have to be changed upstream to keep tests happy, I will do patches later. :D Change-Id: I2f2e75d3fa42e8cf6de19a8fbb615bac28efcd54
* Change uses of getDBLoadBalancerFactory() to getConnectionProvider()Bartosz Dziewoński2024-01-221-1/+1
| | | | | | | | | | | | 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
* Migrate remaining Database::insert calls to InsertQueryBuilderAmir Sarabadani2023-12-221-11/+12
| | | | | | | | | Tests are not checked. There is nothing left as far I can check. Bug: T353219 Change-Id: I1d58397118c7ab1110b9d7cf400c59c4bff7378c
* Use real type hints for services etc. in import/Bartosz Dziewoński2023-12-081-4/+1
| | | | | | Also remove redundant doc comments. Change-Id: I2e4eb3f287b6b715dc392811687fdfb9a611b773
* Migrate off wfGetDB() in more places to ICPAmir Sarabadani2023-11-201-2/+2
| | | | | | | | | | | | | | | | | This function is uber-deprecated, meaning even its replacement is deprecated, We have already migrated in static functions and more. In this batch, all calls have been migrated that there is already a call to MediaWikiServices::getInstance() making the migration easier. Of course in most cases, they should eventually turn into proper service injection but this at least makes it clear what services should be injected. Also removing "category" group since we are removing all groups except a handful from mw (see T263127 for more information). Bug: T330641 Change-Id: I90cd35ee45a37eb6e6bf7a531cc8f75effbd0328
* WikiRevision: Preserve lowercase of external actorsFunc2023-09-231-1/+9
| | | | | | | We need a pure UserIdentity. Bug: T347228 Change-Id: Ib52fbc6c797215d7b9b62d99f941d6996bf2d59a
* Merge "Migrate another major batch to SelectQueryBuilder"jenkins-bot2023-09-201-5/+8
|\
| * Migrate another major batch to SelectQueryBuilderAmir Sarabadani2023-09-201-5/+8
| | | | | | | | | | | | | | | | 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 User under \MediaWiki\UserJames D. Forrester2023-09-191-0/+1
|/ | | | | Bug: T166010 Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
* Replace deprecated MWExceptionDaimona Eaytoy2023-06-091-12/+3
| | | | | Bug: T328220 Change-Id: I66be7a6dd752d6b9c254beb65f4eb5ace3c89776
* 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
* import: Mark WikiRevision::$sha1base36 property as privatethiemowmde2023-02-241-8/+4
| | | | | | | | | | Not used anywhere else: https://codesearch.wmcloud.org/search/?q=[%3E:]sha1base36%5Cb&files=%5C.php%24 This allows us to remove the `false` so we can later type the property with `?string`, if we want. Change-Id: I4d40ea90f63ba9de1d7558980127691691010325
* Remove WikiRevision::importUploadMatěj Suchánek2023-01-151-13/+0
| | | | | | It has been deprecated since 1.31 and it is unused. Change-Id: I3c106c6aa3726ec0d36bb5f05af81717425b9af5
* Use CommentStore service instead of deprecated methodDerick Alangi2023-01-041-4/+3
| | | | | | | | Also, added a parameters to XmlDumpWriter so that they could be inject via WikiExporter. Bug: T325475 Change-Id: I84b82506509e2c09dad0691af2df958a5af5b5b0
* Split a base class out of CommentStoreAlexander Vorwerk2023-01-011-0/+2
| | | | | | | | | | 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
* Make use of ??= in more placesDannyS7122022-12-171-11/+5
| | | | | | New feature from PHP 7.4 Change-Id: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
* Various doc fixes about false on method arguments/return typesUmherirrender2022-11-101-3/+3
| | | | | | Doc-only changes Change-Id: I5177f582ae7ee70c357e9389fed14819faf79463
* Remove WikiRevision::downloadSourceMatěj Suchánek2022-11-041-28/+1
| | | | | | It has been deprecated since 1.31 and it is unused. Change-Id: I695e7f5d253076829ba9b58bccd7bfc77624c393
* Better document the type of timestamp accepted/returnedthiemowmde2022-11-021-2/+2
| | | | | | Related to I29399e7. Change-Id: Iafa1fcac95f9b7a6cbc3a8ae9d4aff825acb302d
* Remove WikiRevision::$fileIsTempMatěj Suchánek2022-11-011-12/+0
| | | | | | It has been deprecated since 1.29 and it is unused. Change-Id: I4a737273fcf03f33ab3dc6e56e9becbdb7a79c00
* Hard deprecate WikiRevision::downloadSourceMatěj Suchánek2022-07-081-1/+2
| | | | | | It has been deprecated since 1.31 and it is unused. Change-Id: Ieb2273939fa5d4244ccf1fd4a653ec784167dfe1
* Hard deprecate access to WikiRevision::$fileIsTempMatěj Suchánek2022-07-051-2/+5
| | | | | | The property has been deprecated since 1.29. Change-Id: I04ab2fc7aac85f448ebef3bb5bc24aa5c617f233
* import: Soft-deprecate WikiRevision::getUserObj and related methodsThiemo Kreuz2022-05-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Reasoning: * Not all code needs an actual User object. And even if, most code doesn't need it to be validated. That's expensive. Let the users decide. * setUserObj() is almost never called anyway. And the few places that call it go the extra mile and create a User object just to please this setter. We can avoid or at least postpone this. * All callers already fall back to getUser() when there is no getUserObj(). * For a while we try to replace the User class with much smaller interfaces, whenever possible. This is a chance to remove of one more. * A "user IP" is a concept that doesn't even exist in this code. The setter writes to the same property as setUsername(). This makes it very easy to use these methods wrong, and this indeed already happened in some places. Change-Id: I6687305a5be68e8a068f11482625a0a6bd9626f2
* import: Fix incomplete type hint for WikiRevision::getUserObjThiemo Kreuz2022-05-151-3/+4
| | | | | | | | | | | | | This is almost always null. All callers expect this already and fall back to getUser(). It looks like setUserObj() is sometimes called with false. Luckily the users I can find use the ?: operator and behave the same, no matter if they get null or false. Let's fix it anyway to make the code less surprising. Depends-On: Id019f633a19f925faa1e5890a9b7818bb9e81a84 Change-Id: I128c21c60f6bb017521218933c22e6f1754e9133
* Use MainConfigNames instead of string literalsAryeh Gregor2022-04-111-1/+2
| | | | | | | | Part 1, proof of concept. Hundreds of files left to go. These changes brought to you in large part by vim macros. Bug: T305805 Change-Id: I44789091e9f6394c800a11b29f22528c8dcacf71
* Consistently use `@deprecated since` rather `@deprecated`Reedy2022-03-061-1/+1
| | | | Change-Id: I301786f35cd6eb9c63fb72e0b64cffa9efd7b86b
* Merge "Same code style and formatting for exists-style SQL queries"jenkins-bot2021-08-241-1/+1
|\
| * Same code style and formatting for exists-style SQL queriesThiemo Kreuz2021-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Queries that query a value "1" are expected to return either that "1" (possibly as a string), or false. It's safe to simply cast this to bool and use it as it is. Queries for COUNT(*) are expected to return that number, possibly as a string. It's not possible for such a query to return false. And even if, casting to 0 is fine. I found an existing code style where the table name and the "1" are on the same line as the selectField() method name, and applied it to all similar queries. Change-Id: I9453196281871c03ef03f653f43762eb9284342f
* | WikiRevision: ensure that $comment is a stringDaimona Eaytoy2021-08-141-2/+2
|/ | | | | | | It's documented as string only, but some code (possibly test code) is passing null, causing failures for I0e7e4a48b56c3e5fde56f50693fd0cdc19c30dd0. Change-Id: I07e2fc0c6249e8bcda3af99213fcf26f17e6df94
* Replace uses of DB_MASTER with DB_PRIMARYJames D. Forrester2021-04-291-1/+1
| | | | | | Just an auto-replace from codesniffer for now. Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
* Stop using legacy ActorMigration field "log_user"Tim Starling2021-04-281-2/+4
| | | | | Bug: T278917 Change-Id: I1b78bad7e1fa43f5f82908567a7daad9c6cc79b9
* Improve and add documentation to import/export related classesUmherirrender2021-02-011-0/+1
| | | | Change-Id: Ib2a74c1ac1a1902341e289961f4c1aa4dadd4bd8
* WikiRevision::model can be null so don't pass it as an argAriel T. Glenn2021-01-221-1/+1
| | | | | | Use getModel() as the arg instead Change-Id: Ie23d31885416abdcc639f4fc5028961ba80de495
* Hard deprecate WikiRevision::importUploadAmmar Abdulhamid2020-11-201-0/+2
| | | | | | | Soft deprecated since 1.31 and no longer in use save one usage in WikiImporter which has been replaced too. Change-Id: I88305fb7579d66fd402646f1717f2d528bf90d02
* MCR importdaniel2020-07-181-7/+57
| | | | | Bug: T220525 Change-Id: I7d41a8af12e33aed802526eb39a0880292c4f534
* Remove terminating line breaks from debug messagesTim Starling2020-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | A terminating line break has not been required in wfDebug() since 2014, however no migration was done. Some of these line breaks found their way into LoggerInterface::debug() calls, where they mess up the formatting of the debug log. So, remove terminating line breaks from wfDebug() and LoggerInterface::debug() calls. Also: * Fix the stripping of leading line breaks from the log header emitted by Setup.php. This feature, accidentally broken in 2014, allows requests to be distinguished in the log file. * Avoid using the global variable $self. * Move the logging of the client IP back to Setup.php. It was moved to WebRequest in the hopes that it would not always be needed, however $wgRequest->getIP() is now called unconditionally a few lines up in Setup.php. This means that it is put in its proper place after the "start request" message. * Wrap the log header code in a closure so that variables like $name do not leak into global scope. * In Linker.php, remove a few instances of an unnecessary second parameter to wfDebug(). Change-Id: I96651d3044a95b9d210b51cb8368edc76bebbb9e
* Introduce ContentHandlerFactoryArtBaltai2020-02-071-1/+4
| | | | | | | | | | | | | | | | | Added: - ContentHandlerFactory Tests: - PHPUnit Changed - Calls of changed and deprecated - DI for some service/api Deprecated: - ContentHandler::* then similar to ContentHandlerFactory - ContentHandler::getForTitle - ContentHandler::$handlers Bug: T235165 Change-Id: I59246938c7ad7b3e70e46c9e698708ef9bc672c6
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-101-5/+5
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* Remove duplicate variable name from class property PHPDocsThiemo Kreuz2019-12-021-1/+1
| | | | | | | | | | | Repeating the variable name doesn't do anything. Documentation generators don't need it. It's more stuff to read that doesn't add new information. And it can become outdated. Note there are two types of @var docs. When used inline (and not on a class property) the variable name is needed. Change-Id: If5a520405efacd8cefd90b878c999b842b91ac61
* import: Update docs about WikiRevision requiring a ConfigThiemo Kreuz2019-09-171-1/+8
| | | | Change-Id: I5a3d6883150d63d16c1d59ae202e884acb7ec429
* Include change tags in revision import structureAdam Wight2019-09-031-0/+22
| | | | | | | | This makes it possible to import change tags, which will be leveraged by Extension:FileImporter. Bug: T227849 Change-Id: I70a8df2b2be0ec11806eb8d798115c52683cc787
* Merge "Improve type hints in export related classes"jenkins-bot2019-07-251-1/+1
|\
| * Improve type hints in export related classesUmherirrender2019-07-051-1/+1
| | | | | | | | Change-Id: I3a11173bc96611c69cdc615eba741c6e4f92824a
* | Clarify WikiRevision::downloadSource() and related codeLucas Werkmeister2019-06-121-2/+2
|/ | | | | | | | | | | | | | | | UploadImporter was the name of the new class in the first patch sets of change I4a6c573fc0, but by the time it was merged as commit 25fbfd9b9c it had been split into an UploadRevisionImporter interface with an ImportableUploadRevisionImporter implementation; however, not all the references to those methods were fully updated. Also, downloadSource() is not actually intended as a replacement method – it was introduced, already deprecated, only to avoid going through the deprecation process, with the intention of removing it (and making the implementation private) once enough time had passed. Update the comments to clarify this as well. Change-Id: I50a07c0db102cdc98e5b7c1a176f401b87d627c9
* Removed 'public $user' as it is deprecated in 1.29zoranzoki212019-05-211-8/+0
| | | | Change-Id: If9c59d432e4b8b91b8c81200bf3a8a910461eded