aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/generateJsonI18n.php
Commit message (Collapse)AuthorAgeFilesLines
* build: Upgrade mediawiki/mediawiki-phan-config from 0.14.0 to 0.15.0James D. Forrester2024-12-191-1/+1
| | | | | | | | | | | | | Suppress remaining issues Depends-On: I633ec05fe9ab6a815225911d942ecb79f21c428f Depends-On: I186e799256fbaf5ee77558bd146f9418dd5eaacc Depends-On: Ib84b7d71e8308a36409f30ecfd16e9de149e97b3 Depends-On: I26aa4adf31b4142248abe3e0f9aa8314512602a6 Depends-On: Icf24e208a487bafe3d1983536870aac19cfc4b5e Depends-On: I99915b893f14cfbb2b54d9a6264b4f294200c4f2 Depends-On: Ia53b71dff3299837856ae3c004cd0227bd45e05b Change-Id: I825dce05d4a6ca87acf25063e3664cb2d16f5db0
* add `use MediaWiki\Maintenance\Maintenance` to some maintenance classesNovem Linguae2024-12-041-0/+1
| | | | | | | | | | | | | F–P. Still need to do P–Z. there's a couple spots where I added `use MediaWiki\Maintenance\LoggedUpdateMaintenance;` or similar instead. some of the existing "use" blocks were in weird spots (e.g. above the copyright docblock, or too far down). i didn't move those because they are out of scope for this patch. Change-Id: I5b6a8f3eae5be85d67bccfcce31c0c2027850f45
* Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have bolierplate code that is added before and after the class to allow directly running the maintenance script. * Running the maintenance script directly has been deprecated since 1.40, so this boilerplate code is only to support a now deprecated method of running maintenance scripts. * This code cannot also be marked as covered, due to PHPUnit not recognising code coverage for files. * Therefore, it is best to ignore this boilerplate code in code coverage reports as it cannot be marked as covered and also is for deprecated code. What: * Wrap the boilerplate code (requiring Maintenance.php and then later defining the maintenance script class and running if the maintenance script was called directly) with @codeCoverageIgnore comments. * Some files use a different boilerplate code, however, these should also be marked as ignored for coverage for the same reason that coverage is not properly reported for files. Bug: T371167 Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
* Add namespace and deprecation alias to FormatJsonEbrahim Byagowi2024-05-161-0/+2
| | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Json to FormatJson and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
* maintenance: Check return of preg_match_all in generateJsonI18n.phpUmherirrender2022-03-291-4/+1
| | | | | | | Help phan to understand the values in $matches Bug: T304887 Change-Id: Ie9610a6e83731468311edb3ed17f80fc509de385
* phan: Enable redundant_condition_detectionUmherirrender2020-07-011-0/+1
| | | | | | | | Remove duplicate casts Suppress false positives Bug: T248438 Change-Id: I2f89664a4bcd3b39b15e7cf850adda2f0c90ae6f
* Add /** @var SplFileInfo $fileInfo */ docs where neededThiemo Kreuz2019-03-141-0/+1
| | | | Change-Id: Ia844af3347db52f9f004892578ba4aefac7dd875
* Update PHPDoc types in several maintenance scripts and relatedThiemo Kreuz2019-03-071-1/+1
| | | | | | | | | | There is like a billion of these in our core codebase. I would love to update them all. But I don't have the time, at least not to do them all at once. TL;DR: It's an improvement. :-) Change-Id: I0a9c51bdcf0f261f971586bb8703f418324b0f98
* Use ::class to resolve class names in maintenance scriptsUmherirrender2018-01-231-1/+1
| | | | | | | This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
* Maintenance: add fatalError() methodBryan Davis2017-11-211-8/+8
| | | | | | | | Deprecate the second argument to Maintenance::error() in favor of a new Maintenance::fatalError() method. This is intended to make it easier to review flow control in maintenance scripts. Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
* Un-blacklist PhanUndeclaredVariableErik Bernhardson2017-01-181-0/+1
| | | | | | | | | | Undeclared variables are a very common error type that we want to catch as often as possible. To avoid needing to refactor a variety of global level code (mostly in old-style maintenance scripts) this ignores undeclared variables in global scope. This is still a good improvement over what was happening previously. Change-Id: I50b41d571724244552074b9408abbdf6160aca59
* Convert all array() syntax to []Kunal Mehta2016-02-171-2/+2
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Use addDescription() instead of accessing mDescription directlyMax Semenik2016-01-301-1/+1
| | | | Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
* generateJsonI18n.php: Remove features that should no longer be neededKevin Israel2015-04-301-113/+21
| | | | | | | | | | | * Removed --langcode, which was for converting core messages files. * Do not generate backward compatibility shims. MediaWiki 1.19 will enter end-of-life status in May 2015. * Print a special error message for shims, which is different from the one that used to refer to --langcode. * Removed extra newlines from error messages. Change-Id: Ic8498fbdd7c2bd6e30ddbd96da85b2b8b23d706b
* Break some long lines in maintenance, skins, testsumherirrender2014-07-241-1/+2
| | | | Change-Id: I5d86ad3e0c90e09440268a670f5af3e2bf080612
* Add --supplementary flag to generateJsonI18nAdam Roses Wight2014-05-101-1/+25
| | | | | | | | | | | Recursively searches the DonationInterface extension for i18n files and performs default conversion on the lot. Usage: php maintenance/generateJsonI18n.php \ --extension DonationInterface --supplementary Change-Id: I8e61c3d0f34394c0d766cf9532df9ac221ce7405
* Adds an --extension option to generateJsonI18nAdam Roses Wight2014-05-101-3/+38
| | | | | | | | | | | | | | Usage: php maintenance/generateJsonI18n.php --extension WikiLove Performs the default conversions in $IP/extensions/WikiLove/, replacing the WikiLove.i18n.php file with a backwards-compatibility shim and porting messages to the WikiLove/i18n/ directory. This patch has the side-effect of making the second cmdline argument in the ordinary usage optional. When omitted, we will make the default guess as to $jsondir, that it should live in the same directory as the .i18n.php file. Change-Id: I6246d2c4eb7327d6dcc503421b71ffdcaf01769c
* Update formatting in maintenance/ (3/4)Siebrand Mazeland2014-04-231-0/+3
| | | | Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
* Merge "JSON i18n shim: Only register LocalisationCacheRecache handler once"jenkins-bot2014-04-221-15/+61
|\
| * JSON i18n shim: Only register LocalisationCacheRecache handler onceKevin Israel2014-04-171-15/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because LocalisationCache::recache() includes PHP shims each time it is called (e.g. for a different language), in such cases as automated testing, the shims could end up registering handlers many times instead of only once, leading to a rather significant, progressively worse slowdown. Checking whether the shim has already been loaded, and if so, not registering the handler again, avoids this performance problem. I also made the shim compatible with PHP 5.2 (minimum PHP version for MW 1.17 - 1.19) by avoiding closures and __DIR__, and I added a --shim-only option to generateJsonI18n.php to allow regenerating existing shims. Bug: 63928 Change-Id: I3bb39e7d2bb094873061b3b2adf7066bf26c1b71
* | generateJsonI18n.php: Use tabs for indentationKevin Israel2014-04-211-1/+1
| | | | | | | | | | Bug: 63444 Change-Id: Iaaf6b1a08c316f29c18fd5c9494decee401a43f1
* | Fixed some @params documentation (maintenance)umherirrender2014-04-171-1/+1
|/ | | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I727deec35a712de0f0c676cc87dfa661f1ee965b
* Add newline at the end of converted json filesNiklas Laxström2014-04-011-1/+1
| | | | | | | | | 1) Some text editors add missing newline at the end of the file automatically. 2) It's generally a nice thing to do to avoid messing up display for example when cat'ing a file Change-Id: Icf636721c4edcf4ae706c9a346fe36233928cae8
* Comment generated code to explain the i18n JSON migration.Adam Roses Wight2014-03-261-0/+11
| | | | Change-Id: I4d41be5a70eab5ceeec3be0bd544e4a87504572a
* Fixed spacingumherirrender2014-03-201-1/+1
| | | | | | | | - Added spaces after if/foreach/catch - Added new line before end of file - Added or removed spaces before/after parenthesis, comma - Added spaces around string concat Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
* Use "elseif" instead of "else if" in PHPAlexandre Emsenhuber2014-03-151-1/+1
| | | | | | Per https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#C_borrowings Change-Id: I5e3a301c2f3c5ec6b965500c43d16022b8b82e59
* Do not suggest to use unused local varsSiebrand Mazeland2014-01-081-1/+1
| | | | Change-Id: I4c2ab60054304593a9fd873b28e160b9d07442f0
* Fix missing apostrophe in maintenance/generateJsonI18n.phpHydriz2014-01-081-1/+1
| | | | Change-Id: I3f678df09853bfdb6295985c81d4469024aecfbb
* generateJsonI18n.php: replace i18n.php with a shimNiklas Laxström2013-12-231-0/+37
| | | | Change-Id: I4b8f1d9c0b13fca3aae0bec5c614218e917691ef
* Script to convert PHP i18n to JSONRoan Kattouw2013-12-201-0/+130
Change-Id: I769d5a106bf6214127cee2056cd64c18ca4182c6