aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/storage
Commit message (Collapse)AuthorAgeFilesLines
...
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-102-3/+3
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUseJames D. Forrester2020-01-101-2/+2
| | | | Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
* build: Upgrade phan to 0.9.0Daimona Eaytoy2019-12-073-3/+5
| | | | | | | | | | | | | | | Scalar casts are still allowed (for now), because there's a huge amount of false positives. Ditto for invalid array offsets. Thoughts about the rest: luckily, many false positives with array offsets have gone. Moreover, since *Internal issues are suppressed in the base config, we can remove inline suppressions. Unfortunately, there are a couple of new issues about array additions with only false positives, because apparently they don't take branches into account. Change-Id: I5a3913c6e762f77bfdae55051a395fae95d1f841
* Use array for 'ORDER BY'Umherirrender2019-11-291-3/+3
| | | | | | | | It is converted to a valid sql string from the abstract database layer Also use array for GROUP BY and column alias Change-Id: I293a563607d115a42c8456c9b9ac66665d71d943
* Set method visibility on maintenance scriptsUmherirrender2019-11-163-38/+38
| | | | Change-Id: I44c82fbe65e1d002803ce065df6563f06dd39cd4
* Remove Language::factory and getParentLanguage useAryeh Gregor2019-10-271-1/+3
| | | | Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
* Set public for override of Maintenance functionsUmherirrender2019-10-093-7/+7
| | | | | | | | | | | | The following function are set to public in the parent class and cannot have another visibility in subclasses Maintenance::__construct Maintenance::execute Maintenance::getDbType Maintenance::validateParamsAndArgs Maintenance::setDB Change-Id: I0cd6514642d479aca20f1221bf673b0713c21631
* Merge "Remove Revision::getRevisionText and gated pre-MCR schema access"jenkins-bot2019-09-274-341/+38
|\
| * Remove Revision::getRevisionText and gated pre-MCR schema accessPetr Pchelko2019-09-274-341/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fixT22757.php appears to have been written for T22757 which has been resolved, I assume it can be removed. - compressOld.php - rev_text_id access is gated on MCRSchemaMigrationStage READ_OLD. IT's safe to use the old_text and old_flags directly as we select for them. Also the query ensures external blobs are not selected, so we can use decompressData instead of Revision::getRevisionText. Tested locally. - recompressTracked.php uses a temporary table for tracking the blobs. Table is populated by trackBlobs which explicitly queries for old_id, so using it directly in recompressTracked is ok. Tested locally. - checkStorage.php the affected code attempts to fix broken revisions from a dump, however, it looks like it doesn't work - the code expects revision IDs as input, however it receives an array of text table old_id values. Untested. Bug: T198343 Change-Id: I753019565c15d270c831c995c07c7f1aad887cb6
* | In recompressTracked.php, fix the names of things related to child processesTim Starling2019-09-271-34/+34
|/ | | | | | | The forbidden word was used in two senses, confusing the search and replace done in 3d5016569da984050e. Change-Id: I220a58fd536c828ab5e03a779e45f222d0298f9a
* externalstore: deprecate getLBInfo() dependency in ExternalStoreDBAaron Schulz2019-09-102-3/+3
| | | | | | | | | | Use the cluster and master server info array instead, when possible. Also add initializeTable() method based on the one in addWiki.php. This lets some internals be hidden from that script a bit more. Bug: T231162 Change-Id: I694f12cc800684bcc13351021d9abc9a01bddfe9
* maintenance: Explicitly declare all used propertiesDaimona Eaytoy2019-09-091-0/+2
| | | | | | | All uses were checked with codesearch, and the visibility was chosen as strict as possible. Change-Id: I56666299cc04ccc418e05949422876583982eb3c
* recompressTracked.php: Fix typehint of RecompressTracked::dispatch()Umherirrender2019-09-081-1/+1
| | | | | | | | | Follows-up 4a55e578ff8d73e. This must be the same type as RecompressTracked::dispatchToReplica(). Caught by PhanTypeMismatchArgument, to be enabled in I34d65fe3ff1916f. Change-Id: Ifff0d92752e6664d7745efeb4840c8b5ddb974a4
* Upgrade phan config to 0.7.1Daimona Eaytoy2019-09-041-1/+1
| | | | | | | | This allows us to remove many suppressions for phan false positives. Bug: T231636 Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065 Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
* Unsuppress another phan issue (part 7)Daimona Eaytoy2019-09-031-0/+2
| | | | | | | Bug: T231636 Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9 Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0 Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8
* Unsuppress phan issues part 6Daimona Eaytoy2019-09-011-0/+1
| | | | | | Bug: T231636 Depends-On: I50377746f01749b058c39fd8229f9d566224cc43 Change-Id: I2cd24e73726394e3200a570c45d5e86b6849bfa9
* Unsuppress other phan issues (part 4)Daimona Eaytoy2019-08-311-1/+1
| | | | | | Bug: T231636 Depends-On: I58e67c2b38389df874438deada4239510d21654f Change-Id: I6e5fba7bd273219b1206559420b5bdb78734aa84
* Convert maintenance scripts to LoadBalancer::getMaintenanceConnectionRef()Aaron Schulz2019-08-023-8/+9
| | | | Change-Id: I8944a052f51a1941ad3b76a40fc9c46d1363c426
* Merge "Replace wfWiki() usage with WikiMap in some additional places"jenkins-bot2019-07-231-1/+3
|\
| * Replace wfWiki() usage with WikiMap in some additional placesAaron Schulz2019-07-041-1/+3
| | | | | | | | Change-Id: Ide4518292bd9392d09f701b2c301673687d19f3b
* | maintenance: Avoid usage of deprecated Revision::* constantsDerick Alangi2019-07-211-1/+2
| | | | | | | | | | | | | | Update deprecated Revision::* constants to use RevisionRecord::* equivalents. Change-Id: Icae1ebb088e4efadbc7c2806127a2073d337fa05
* | Merge "Migrate various callers away from wfWikiId() to WikiMap"jenkins-bot2019-07-121-1/+1
|\ \
| * | Migrate various callers away from wfWikiId() to WikiMapAaron Schulz2019-07-121-1/+1
| |/ | | | | | | Change-Id: Idc2980c05873c428fb5ffa6ab89f723d33217a8e
* / Normalize the code style of some ResultWrapper iteration loopsAaron Schulz2019-07-101-3/+3
|/ | | | Change-Id: Iced52ae65d31d1ca0cd2c64ebc9ab56b2aef9617
* Make ExternalStore wrap ExternalStoreFactory and create access classAaron Schulz2019-06-284-12/+26
| | | | | | | | | | | | | | | * Inject settings and global instances as dependencies to the ExternalStoreMedium instances. This includes the local wiki domain, so that wfWikiId() calls are not scattered around. * Create ExternalStoreAccess service for read/write logic. * Deprecate the ExternalStore wrapper methods. * Add some exception cases for bogus store URLs are used instead of just giving PHP warnings and failing later. * Make moveToExternal.php require the type/protocol to decide which ExternalStoreMedium to use instead of assuming "DB". * Convert logging calls to use LoggerInterface. Change-Id: I40c3b5534fc8a31116c4c5eb64ee6e4903a6197a
* Remove references to field rev_text_idBill Pirkle2019-04-223-53/+95
| | | | | | | | Field rev_text_id is being retired as part of MCR Schema Migration. Remove references to this field from maintenance scripts. Bug: T198341 Change-Id: I43ab93c44cbd0a2a2479baf848f50348e1e4762b
* Remove usages of 'text' flag in revision-related getQueryInfo() callsBill Pirkle2019-04-161-2/+2
| | | | | | | | | | | Field rev_text_id will no longer be populated once the legacy schema is disabled, so joins against it will not work. Remove all usages of the 'text' flag in calls to both Revision::getQueryInfo() and RevisionStore::getQueryInfo() so that these joins are no longer attempted. Bug: T198342 Change-Id: I9be6a544c6f68555d4ea856f949f0040d05eac0f
* Get rid of unnecessary func_get_args() and friendsAryeh Gregor2019-04-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | HHVM does not support variadic arguments with type hints. This is mostly not a big problem, because we can just drop the type hint, but for some reason PHPUnit adds a type hint of "array" when it creates mocks, so a class with a variadic method can't be mocked (at least in some cases). As such, I left alone all the classes that seem like someone might like to mock them, like Title and User. If anyone wants to mock them in the future, they'll have to switch back to func_get_args(). Some of the changes are definitely safe, like functions and test classes. In most cases, func_get_args() (and/or func_get_arg(), func_num_args() ) were only present because the code was written before we required PHP 5.6, and writing them as variadic functions is strictly superior. In some cases I left them alone, aside from HHVM compatibility: * Forwarding all arguments to another function. It's useful to keep func_get_args() here where we want to keep the list of expected arguments and their meanings in the function signature line for documentation purposes, but don't want to copy-paste a long line of argument names. * Handling deprecated calling conventions. * One or two miscellaneous cases where we're basically using the arguments individually but want to use them as an array as well for some reason. Change-Id: I066ec95a7beb7c0665146195a08e7cce1222c788
* Merge "Fix order of @var parameter in PHP"jenkins-bot2019-04-121-1/+1
|\
| * Fix order of @var parameter in PHPFomafix2019-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Replace @var $foo type by @var type $foo Change-Id: Iec8b90ffea4028a1005daef422b7c4ec38c2715f
* | Use https://www.php.net/ instead of https://secure.php.net/Fomafix2019-04-121-1/+1
|/ | | | Change-Id: I0acca592c6909e91b28b904da49dcbd6a43cd2a5
* Replace deprecated function wfEscapeShellArg with Shell::escape()Derick Alangi2019-04-072-5/+7
| | | | Change-Id: I4046d593d1450cfffc489ca2abadba1084a540e4
* Fix/suppress misc phan errors (#5)Kunal Mehta2019-04-051-1/+3
| | | | | | Add lots of missing return statements, or remove incorrect doc blocks. Change-Id: I0881e98fbb9d0d4cf79ecc824064d24538055d3f
* maintenance: Deprecate Maintenance::hasArg/getArg with no paramThiemo Kreuz2019-03-291-1/+1
| | | | | | | | | | | | | | | | | | | Benefit of keeping the parameter optional: - In maintenance scripts that really only have one parameter, it's a little more convenient to be able to ask for *the* parameter via an empty getArg(). Disadvantages: - It's unclear what getArg() means when there is no indication *which* argument the code asks for. This might as well return the last argument, or an array of all arguments. - In scripts with two or more arguments, it's confusing to see getArg( 1 ) next to an empty getArg(). - The methods are more complex and a bit more complicated to use with the extra feature of this parameter being optional. Users need to look up what the default is to be able to use it safely. Change-Id: I22a43bfdfc0f0c9ffdb468c13aba73b888d1f15e
* Avoid using calls to freeResults() and allow object go out of scopeDerick Alangi2019-03-231-7/+0
| | | | | Bug: T26712 Change-Id: Ie97b6f3e3cfc4dc010900ebde5ff8e5afec10727
* build: Updating mediawiki/mediawiki-codesniffer to 24.0.0Kunal Mehta2019-02-071-1/+0
| | | | Change-Id: I66b1775b7c1d36076d9ca78cbeb42787a743f2aa
* No yoda conditionsFomafix2018-11-211-2/+2
| | | | | | | | | Replace if ( 42 === $foo ) by if ( $foo === 42 ) Change-Id: Ice320ef1ae64a59ed035c20134326b35d454f943
* Use PHP 7 '??' operator instead of if-then-elseFomafix2018-10-273-15/+3
| | | | Change-Id: Ia86f8433f30a166d38ee63d0d1745b26740767b9
* Use "break" instead of "continue" inside a switchRazeSoldier2018-10-151-2/+2
| | | | | | | "continue" statements in a switch are equivalent to "break". In PHP 7.3, will generate a warning. Bug: T206974 Change-Id: I54bcec013ff52ab81bff09f8f7ef02f3944a5b7d
* 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
* Add constant for the name of the 'main' slot for MCRGergő Tisza2018-09-241-2/+3
| | | | | Bug: T202142 Change-Id: I97a74e5a029b014f3c2195188936d5c8233c1b7f
* Add missing use statementsUmherirrender2018-06-271-1/+2
| | | | | | Swap some ResultWrapper/Database to interface IResultWrapper/IDatabase Change-Id: I312cb3cca5742f72efdb0965ba35362f2eb1129d
* PHP: Use short ternary operator (?:) where possibleFomafix2018-06-111-1/+1
| | | | Change-Id: Idcc7e4fcdd4d8302ceda44bf6d294fa8c2219381
* Replace call_user_func_array(), part 2Max Semenik2018-06-071-3/+3
| | | | | | | | | | | | | | | Uses new PHP 5.6 syntax like ...parameter unpacking and calling anything looking like a callback to make the code more readable. There are much more occurrences but this commit is intentionally limited to an easily reviewable size. In one occurrence, a simple conditional instead of trickery was much more readable. This patch finishes all the easy stuf in the core, the remainder is either unobvious or would result in smaller readability gains. It will be carefully dealt with in further commits. Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-303-3/+3
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* Use PHP 5.6 '**' operator instead of 'pow()' functionBartosz Dziewoński2018-05-301-1/+1
| | | | Change-Id: Ieb22e1dbfcffaa4e7b3dcfabbcc999e5dd59a4bf
* Replace HTTP by HTTPSFomafix2018-05-221-1/+1
| | | | | | | | | | | * https://www.unicode.org/ instead of http://www.unicode.org/ or http://unicode.org/ * https://secure.php.net/ instead of http://www.php.net/ or http://php.net/ * https://hhvm.com/ instead of http://hhvm.com/ * https://www.iis.net/ instead of http://www.iis.net/ Change-Id: I84d818a7e0ced5ffb9485ec89a75efb28a77c1e0
* Rewrite DumpRev to not always fatal outAaron Schulz2018-04-271-40/+16
| | | | | | | * The method fetchBlob() is private. * Also remove all of the code duplication. Change-Id: Ie307a937bcfd835a3239af23fb8deeb78704e0fe
* Drop archive.ar_text and ar_flagsBrad Jorsch2018-04-031-19/+0
| | | | | | | | | | This should have been done long ago. Now it is being done. This also changes ar_text_id to NOT NULL, since it should never be null anymore, and DEFAULT 0 in preparation for MCR stopping writing it. Bug: T33223 Change-Id: I18f1c740b7537c7dc3cfeba9b241d0a9f31caa34
* Merge "Replace wfGetLBFactory"jenkins-bot2018-03-093-3/+9
|\