lhc/web/wiklou.git
4 years agoMerge "Better grouping for code adding elements to arrays"
jenkins-bot [Tue, 3 Sep 2019 19:00:53 +0000 (19:00 +0000)]
Merge "Better grouping for code adding elements to arrays"

4 years agoMerge "resourceloader: Add wgWikiID to mw.config in the startup module"
jenkins-bot [Tue, 3 Sep 2019 18:39:32 +0000 (18:39 +0000)]
Merge "resourceloader: Add wgWikiID to mw.config in the startup module"

4 years agoMerge "Removing highlighting from mobile rcfilters"
jenkins-bot [Tue, 3 Sep 2019 18:31:41 +0000 (18:31 +0000)]
Merge "Removing highlighting from mobile rcfilters"

4 years agoresourceloader: Add wgWikiID to mw.config in the startup module
Roan Kattouw [Thu, 4 Jul 2019 01:41:07 +0000 (18:41 -0700)]
resourceloader: Add wgWikiID to mw.config in the startup module

This was previously just added by Echo, but it's generally useful.

We should probably deprecate wgDBname, because wgWikiID is a better wiki
identifier that also works when two wikis have different table prefixes
in the same database, but that'll take some work because a number of
things rely on it right now (including ResourceLoader itself, for its
localStorage keys).

Change-Id: I4d289267991f1f9a8e0710ec6ee5a2131306c510

4 years agoMerge "Unsuppress another phan issue (part 7)"
jenkins-bot [Tue, 3 Sep 2019 17:45:53 +0000 (17:45 +0000)]
Merge "Unsuppress another phan issue (part 7)"

4 years agoMerge "preferences: Add typehint in saveFormData() for PreferencesFormOOUI"
jenkins-bot [Tue, 3 Sep 2019 17:41:35 +0000 (17:41 +0000)]
Merge "preferences: Add typehint in saveFormData() for PreferencesFormOOUI"

4 years agoBetter grouping for code adding elements to arrays
Daimona Eaytoy [Tue, 3 Sep 2019 17:38:57 +0000 (19:38 +0200)]
Better grouping for code adding elements to arrays

Change-Id: I7cc8c810f0dcf1ee84b9d5f14967ec2568e3e0be
Follow-up: I50377746f01749b058c39fd8229f9d566224cc43

4 years agoRemoving highlighting from mobile rcfilters
Jan Drewniak [Thu, 29 Aug 2019 09:30:19 +0000 (11:30 +0200)]
Removing highlighting from mobile rcfilters

Removes the highlighting feature from rcfilters (e.g. Special:RecentChanges)
when OO.ui.isMobile() is true (isMobile is true when MobileFrontend
is enabled).

Also prevents the "enhanced" list view module from being loaded in mobile mode,
as the option to do so is disabled for mobile.

Bug: T231054
Change-Id: I1d4e1fdef6469f461ff4dad168ce01c856531d1c

4 years agoUnsuppress another phan issue (part 7)
Daimona Eaytoy [Sat, 31 Aug 2019 16:14:38 +0000 (18:14 +0200)]
Unsuppress another phan issue (part 7)

Bug: T231636
Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0
Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8

4 years agoMerge "Revert "Modify -—with-extensions to throw extension dependency errors""
jenkins-bot [Tue, 3 Sep 2019 17:15:04 +0000 (17:15 +0000)]
Merge "Revert "Modify -—with-extensions to throw extension dependency errors""

4 years agopreferences: Add typehint in saveFormData() for PreferencesFormOOUI
Daimona Eaytoy [Mon, 2 Sep 2019 16:13:02 +0000 (16:13 +0000)]
preferences: Add typehint in saveFormData() for PreferencesFormOOUI

This was temporarily removed in 3bcf5655870f for compat with
the GlobalPreferences extension. The old typehint of HTMLForm
was incorrect (as discovered by a Phan rule that was disabled
for core), because getModifiedUser() only exists in the
PreferencesFormOOUI subclass.

Change-Id: I792286ed44f03467b5d875e61c52b1953252b55f
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0

4 years agoMerge "resourceloader: Move mw.user skeleton from startup to base"
jenkins-bot [Tue, 3 Sep 2019 16:50:02 +0000 (16:50 +0000)]
Merge "resourceloader: Move mw.user skeleton from startup to base"

4 years agoRevert "Modify -—with-extensions to throw extension dependency errors"
Jforrester [Tue, 3 Sep 2019 16:35:48 +0000 (16:35 +0000)]
Revert "Modify -—with-extensions to throw extension dependency errors"

This reverts commit d9eec3c9124d87fd44e6917d5b1512b78352afb3.

Reason for revert: Breaking most of CI

Bug: T231876
Change-Id: I9b64a2bb770ee2e7ee717669070843814f37e81e

4 years agoLocalRepo: Remove leading 0 from 32-byte SHA1 keys
Marko Obrovac [Tue, 3 Sep 2019 13:57:33 +0000 (15:57 +0200)]
LocalRepo: Remove leading 0 from 32-byte SHA1 keys

Bug: T230667
Change-Id: I3d9de7a92495e894b4b44b0a5b0646b6d720f7c2

4 years agoModify -—with-extensions to throw extension dependency errors
Clara Andrew-Wani [Thu, 29 Aug 2019 14:56:27 +0000 (10:56 -0400)]
Modify -—with-extensions to throw extension dependency errors

Changes the behavior of -—with-extensions from silently skipping
extensions that lack another extension dependency to throwing an
install exception.

Bug: T225512
Change-Id: Ia5b41841aaf55fa5c4971ae67218f8231f8adcb8

4 years agoMerge "FileJournal tests"
jenkins-bot [Tue, 3 Sep 2019 11:22:00 +0000 (11:22 +0000)]
Merge "FileJournal tests"

4 years agoFileJournal tests
Aryeh Gregor [Thu, 22 Aug 2019 06:47:54 +0000 (09:47 +0300)]
FileJournal tests

100% unit test coverage for FileJournal and NullFileJournal. 100%
integration test coverage for DBFileJournal. Unit tests for
DBFileJournal once it supports injection.

I removed FileJournal and NullFileJournal from the list of classes that
FileBackendTest tests. It doesn't actually test them, it just happens to
run code from them without checking its correctness at all.

Depends-On: Ic22075bb5e81b7c2c4c1b8647547aa55306a10a7
Change-Id: I46d10ab7b87c23937aa04d7ec1922abfcf3bd611

4 years agoMerge "Add $specialPageAliases and $magicWords for Tajik"
jenkins-bot [Mon, 2 Sep 2019 23:17:22 +0000 (23:17 +0000)]
Merge "Add $specialPageAliases and $magicWords for Tajik"

4 years agoMerge "Correct the wording of the backend-fail-hash message"
jenkins-bot [Mon, 2 Sep 2019 23:12:30 +0000 (23:12 +0000)]
Merge "Correct the wording of the backend-fail-hash message"

4 years agoMerge "Use IDatabase::buildStringCast in Special:MediaStatistics"
jenkins-bot [Mon, 2 Sep 2019 23:12:21 +0000 (23:12 +0000)]
Merge "Use IDatabase::buildStringCast in Special:MediaStatistics"

4 years agoMerge "Use Maintenance::getConfig in some maintenance scripts"
jenkins-bot [Mon, 2 Sep 2019 23:12:15 +0000 (23:12 +0000)]
Merge "Use Maintenance::getConfig in some maintenance scripts"

4 years agoMerge "Add Martin Urbanec to .mailmap"
jenkins-bot [Mon, 2 Sep 2019 23:03:18 +0000 (23:03 +0000)]
Merge "Add Martin Urbanec to .mailmap"

4 years agoMerge "phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase"
jenkins-bot [Mon, 2 Sep 2019 20:52:18 +0000 (20:52 +0000)]
Merge "phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase"

4 years agophpunit: Repair GLOBALS reset in MediaWikiUnitTestCase
Timo Tijhof [Wed, 7 Aug 2019 13:40:55 +0000 (14:40 +0100)]
phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase

This code didn't work because the $GLOBALS array is exposed by reference.
Once this reference was broken by unset(), the rest just manipulated a
local array that happens to be called "GLOBALS". It must not be unset or
re-assigned. It can only be changed in-place.

Before this, the execution of a MediaWikiUnitTestCase test stored a
copy of GLOBALS in unitGlobals, then lost the GLOBALS pointer and
created a new variable called "GLOBALS". As such, the tearDown() function
didn't do what it meant to do, either – which then results in odd
failures like T230023

Rewrite it as follows:

* In setup, store the current GLOBALS keys and values, then reduce
  GLOBALS to only the whitelisted keys and values.

* In teardown, restore the original state.

* As optimisation, do this from setUpBeforeClass as well, so that
  there are relatively few globals to reset between tests.
  (Thanks @Simetrical!)

The following tests were previously passing by accident under
MediaWikiUnitTestCase but actually did depend on global config.

* MainSlotRoleHandlerTest (…, ContentHandler, $wgContentHandlers)
* SlotRecordTest (…, ContentHandler, $wgContentHandlers)
* WikiReferenceTest (wfParseUrl, $wgUrlProtocols)
* DifferenceEngineSlotDiffRendererTest (DifferenceEngine, wfDebug, …)
* SlotDiffRendererTest (…, ContentHandler, $wgContentHandlers)
* FileBackendDBRepoWrapperTest (wfWikiID, "Backend domain ID not provided")
* JpegMetadataExtractorTest (…, wfDebug, …, LoggerFactory, …)
* ParserFactoryTest (…, wfDebug, …, LoggerFactory, InvalidArgumentException)
* MediaWikiPageNameNormalizerTest (…, wfDebug, …, LoggerFactory, …)
* SiteExporterTest (SiteImporter, wfLogWarning, …)
* SiteImporterTest (Site::newForType, $wgSiteTypes)
* ZipDirectoryReaderTest (…, wfDebug, …, LoggerFactory, …)

Bug: T230023
Change-Id: Ic22075bb5e81b7c2c4c1b8647547aa55306a10a7

4 years agoMerge "Fix duplicate Jon Harald Søby in CREDITS"
jenkins-bot [Mon, 2 Sep 2019 19:37:19 +0000 (19:37 +0000)]
Merge "Fix duplicate Jon Harald Søby in CREDITS"

4 years agoCorrect the wording of the backend-fail-hash message
Amir Aharoni [Mon, 2 Sep 2019 19:08:22 +0000 (22:08 +0300)]
Correct the wording of the backend-fail-hash message

Change-Id: I5dfc0fa4ecc04cd2e31a633b3a6473eca48ec6c4

4 years agoMerge "Permit case independent unit test directories"
jenkins-bot [Mon, 2 Sep 2019 17:08:22 +0000 (17:08 +0000)]
Merge "Permit case independent unit test directories"

4 years agoMerge "objectcache: Optimise array_map in MemcachedBagOStuff::makeKey()"
jenkins-bot [Mon, 2 Sep 2019 17:00:21 +0000 (17:00 +0000)]
Merge "objectcache: Optimise array_map in MemcachedBagOStuff::makeKey()"

4 years agoMerge "ProxyLookup: Optimise in_array in isConfiguredProxy()"
jenkins-bot [Mon, 2 Sep 2019 17:00:13 +0000 (17:00 +0000)]
Merge "ProxyLookup: Optimise in_array in isConfiguredProxy()"

4 years agoMerge "Rework ApiUploadTest"
jenkins-bot [Mon, 2 Sep 2019 16:54:56 +0000 (16:54 +0000)]
Merge "Rework ApiUploadTest"

4 years agoMerge "Correctly format null error reporting level"
jenkins-bot [Mon, 2 Sep 2019 16:54:48 +0000 (16:54 +0000)]
Merge "Correctly format null error reporting level"

4 years agoMerge "Use the existing link renderer in the special page pagers"
jenkins-bot [Mon, 2 Sep 2019 13:11:13 +0000 (13:11 +0000)]
Merge "Use the existing link renderer in the special page pagers"

4 years agoApiQueryCategories: Supply limit for DB query
Brad Jorsch [Wed, 28 Aug 2019 20:34:30 +0000 (16:34 -0400)]
ApiQueryCategories: Supply limit for DB query

The limit is applied in PHP, but all matching rows are being fetched
from the database. We should only fetch the number of rows needed.

Bug: T231462
Change-Id: Ie64ea6f79a187942c476868c383a1349d110aa7c

4 years agoMerge "Revert "Reset $wgContLang consistently for tests""
jenkins-bot [Mon, 2 Sep 2019 11:28:10 +0000 (11:28 +0000)]
Merge "Revert "Reset $wgContLang consistently for tests""

4 years agoMerge "Permit destructors in MediaWikiTestCaseTrait::createNoOpMock"
jenkins-bot [Mon, 2 Sep 2019 11:11:57 +0000 (11:11 +0000)]
Merge "Permit destructors in MediaWikiTestCaseTrait::createNoOpMock"

4 years agoRevert "Reset $wgContLang consistently for tests"
Ladsgroup [Mon, 2 Sep 2019 11:03:18 +0000 (11:03 +0000)]
Revert "Reset $wgContLang consistently for tests"

This reverts commit 09407afd74104bb3a674e4f5c48d10b15914d0db.
Reason for revert: It broke Wikibase on master.

Bug: T231799
Change-Id: Ie347abb24183ce3000af4d653ce2343ec7a63290

4 years agoAdd Martin Urbanec to .mailmap
Lucas Werkmeister [Mon, 2 Sep 2019 10:49:06 +0000 (12:49 +0200)]
Add Martin Urbanec to .mailmap

Commit 6ded91313c, presumably created on Gerrit, uses the author name
Urbanecm instead of Martin Urbanec; without this .mailmap entry to fix
it, maintenance/updateCredits.php would add another entry for that name
(he’s already credited under the proper name).

Change-Id: I14c6a58f969f8d10bdd0e3d17566af5ad53e5a8b

4 years agoFix duplicate Jon Harald Søby in CREDITS
Lucas Werkmeister [Mon, 2 Sep 2019 10:40:09 +0000 (12:40 +0200)]
Fix duplicate Jon Harald Søby in CREDITS

There are some commits from “jhsoby <jhsoby@gmail.com>”. Update the
.mailmap to correct the name of those commits (the existing line would
only update <jhsoby@users.mediawiki.org> commits), and remove the jhsoby
line from the CREDITS.

Also remove jeblad from CREDITS – he already has a .mailmap entry
mapping <john.blad@wikimedia.de> to John Erling Blad, but
maintenance/updateCredits.php never removes CREDITS entries, so while it
adds a correct John Erling Blad entry it won’t remove jeblad by itself.

Change-Id: I987d1cb1e5190899d944c0880211296580abbcb6

4 years agoMerge "phpunit: Add more info to LocalSettings.php error in MediaWikiIntegrationTestCase"
jenkins-bot [Mon, 2 Sep 2019 08:55:51 +0000 (08:55 +0000)]
Merge "phpunit: Add more info to LocalSettings.php error in MediaWikiIntegrationTestCase"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 2 Sep 2019 07:19:57 +0000 (09:19 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I17cb40921799c2b97f8c8bfca201c6a77939ce48

4 years agoMerge "Remove Oracle reference from WikiMap"
jenkins-bot [Sun, 1 Sep 2019 23:58:11 +0000 (23:58 +0000)]
Merge "Remove Oracle reference from WikiMap"

4 years agoRemove Oracle reference from WikiMap
Aaron Schulz [Thu, 15 Aug 2019 12:37:29 +0000 (08:37 -0400)]
Remove Oracle reference from WikiMap

Bug: T230418
Change-Id: I06536034a9d7f176e65b087cc2d3ad65d172961b

4 years agoReset $wgContLang consistently for tests
Aryeh Gregor [Sun, 1 Sep 2019 08:39:50 +0000 (11:39 +0300)]
Reset $wgContLang consistently for tests

We already reset $wgParser to a stub in a number of places where it
might have changed. Let's give $wgContLang the same treatment so we can
avoid special-case code.

This deprecates setContentLang(), which is no longer needed. The magic
of $wgContLang is now handled by setMwGlobals() and setService().

This is a follow-up to e4f69ee, which fixed one case of this problem.

Change-Id: I90925ef8b2a7478cce90d474db1b8b4539e45c15

4 years agoMerge "Avoid multiply calls to MediaWikiServices::getInstance() in one function"
jenkins-bot [Sun, 1 Sep 2019 22:43:06 +0000 (22:43 +0000)]
Merge "Avoid multiply calls to MediaWikiServices::getInstance() in one function"

4 years agoMerge "rdbms: clean up use of ATTACH queries in DatabaseSqlite"
jenkins-bot [Sun, 1 Sep 2019 22:31:08 +0000 (22:31 +0000)]
Merge "rdbms: clean up use of ATTACH queries in DatabaseSqlite"

4 years agoMerge "objectcache: add "sessionConsistencyWindow" option to ReplicatedBagOStuff"
jenkins-bot [Sun, 1 Sep 2019 22:19:59 +0000 (22:19 +0000)]
Merge "objectcache: add "sessionConsistencyWindow" option to ReplicatedBagOStuff"

4 years agoMerge "filebackend: improve FileBackendMultiWrite consistencyCheck()/resyncFiles()"
jenkins-bot [Sun, 1 Sep 2019 22:16:40 +0000 (22:16 +0000)]
Merge "filebackend: improve FileBackendMultiWrite consistencyCheck()/resyncFiles()"

4 years agordbms: clean up use of ATTACH queries in DatabaseSqlite
Aaron Schulz [Mon, 26 Aug 2019 18:17:12 +0000 (11:17 -0700)]
rdbms: clean up use of ATTACH queries in DatabaseSqlite

Defer the queries until a connection exists. Only issue issue the
them for databases that are different than the currently opened file.
Also, make handleSessionLossPreconnect() aware of attached databases.

In LoadBalancer::reallyOpenConnection(), avoid having the "catch" block
appear like it returns a half-constructed Database.

Change-Id: I9f676bb72a1ab06f0eac5820dce28231741c283d

4 years agoobjectcache: add "sessionConsistencyWindow" option to ReplicatedBagOStuff
Aaron Schulz [Sat, 20 Jul 2019 21:59:45 +0000 (14:59 -0700)]
objectcache: add "sessionConsistencyWindow" option to ReplicatedBagOStuff

Change-Id: I25af780f063879eda2de1b9a1168e37115f823ed

4 years agoMerge "Allow CompositeBlock::appliesToRight to return null when unsure"
jenkins-bot [Sun, 1 Sep 2019 21:30:26 +0000 (21:30 +0000)]
Merge "Allow CompositeBlock::appliesToRight to return null when unsure"

4 years agophpunit: Add more info to LocalSettings.php error in MediaWikiIntegrationTestCase
Timo Tijhof [Sun, 1 Sep 2019 20:34:35 +0000 (21:34 +0100)]
phpunit: Add more info to LocalSettings.php error in MediaWikiIntegrationTestCase

Change-Id: I3df68aab40f4b0bb1d5134330347d77ed3399f02

4 years agoAllow CompositeBlock::appliesToRight to return null when unsure
Thalia [Fri, 30 Aug 2019 18:37:15 +0000 (19:37 +0100)]
Allow CompositeBlock::appliesToRight to return null when unsure

CompositeBlock::appliesToRight checks $block->appliesToRight()
for each of the original blocks from which it is made.

AbstractBlock::appliesToRight returns:
* true if the block applies to the right
* false if the block does not apply to the right
* null if unsure

Before this, CompositeBlock::appliesToRight can only return true
or false. After this, it returns:
* false if false for all of the original blocks
* true if true for one or more original blocks
* null otherwise

Bug: T229417
Bug: T231145
Change-Id: Ie93b7691b57ac6a8f86b3641ad07a1d54babcd42

4 years agoMerge "Unit tests: Remove duplicated code in ExtensionRegistry"
jenkins-bot [Sun, 1 Sep 2019 19:56:12 +0000 (19:56 +0000)]
Merge "Unit tests: Remove duplicated code in ExtensionRegistry"

4 years agoUse Maintenance::getConfig in some maintenance scripts
Umherirrender [Mon, 19 Aug 2019 15:44:14 +0000 (17:44 +0200)]
Use Maintenance::getConfig in some maintenance scripts

This avoid global state

Change-Id: Id67d07597159a0bd2721a381775230c3cd1d5509

4 years agoAvoid multiply calls to MediaWikiServices::getInstance() in one function
Umherirrender [Mon, 19 Aug 2019 20:45:43 +0000 (22:45 +0200)]
Avoid multiply calls to MediaWikiServices::getInstance() in one function

RepoGroup::singleton() results in
MediaWikiServices::getInstance()->getRepoGroup()

Also avoid getting the service in loops, doing it once before the loop
is cheaper

Change-Id: I29e0c7487e3e498559ff16a567e2fad0c0f8bb69

4 years agoAdd string cast when outputting exceptions in sql.php
Umherirrender [Thu, 4 Jul 2019 20:33:35 +0000 (22:33 +0200)]
Add string cast when outputting exceptions in sql.php

Change-Id: Ibf21869a2525a8c55f53ec79727c818888344e99

4 years agoUse the existing link renderer in the special page pagers
Umherirrender [Mon, 19 Aug 2019 21:41:04 +0000 (23:41 +0200)]
Use the existing link renderer in the special page pagers

Use SpecialPage::getLinkRenderer and pass it to the pagers
Since I082152b64141f1a9a4085bba23fe81a99ec8d886 it is a property in the
IndexPager and can be used by getLinkRenderer

Change-Id: I2be8a8b9f2b0b8c04fe9e18aa1959987fc125f50

4 years agoPermit case independent unit test directories
mainframe98 [Sun, 1 Sep 2019 15:44:14 +0000 (17:44 +0200)]
Permit case independent unit test directories

If unit tests are namespaced under Tests/Unit/, with tests/phpunit being
the PSR4 root Tests/, then the the unit test directory cannot be named unit/.
The autoloader will not be able to find the files in that namespace, as
it will be looking for the directory Unit/, not unit/.

Change-Id: I8cf6cd31f22decb061650def9e1e5d8893dfa73f

4 years agoMerge "Avoid usage of deprecated setTags() method, use addTags() instead"
jenkins-bot [Sun, 1 Sep 2019 15:25:02 +0000 (15:25 +0000)]
Merge "Avoid usage of deprecated setTags() method, use addTags() instead"

4 years agoAvoid usage of deprecated setTags() method, use addTags() instead
Derick Alangi [Sun, 7 Jul 2019 22:07:56 +0000 (23:07 +0100)]
Avoid usage of deprecated setTags() method, use addTags() instead

$tags can be `null` as seen in most cases and this causes failures,
so, the safer path is to make sure if $tags is a null, do nothing.

Change-Id: I5b7e39adba5d08fdcd42c437a72a391be98c8695

4 years agoUnsuppress phan issues part 6
Daimona Eaytoy [Fri, 30 Aug 2019 18:17:32 +0000 (20:17 +0200)]
Unsuppress phan issues part 6

Bug: T231636
Depends-On: I50377746f01749b058c39fd8229f9d566224cc43
Change-Id: I2cd24e73726394e3200a570c45d5e86b6849bfa9

4 years agoUnsuppress more phan issues (part 5)
Daimona Eaytoy [Fri, 30 Aug 2019 17:56:27 +0000 (19:56 +0200)]
Unsuppress more phan issues (part 5)

Bug: T231636
Depends-On: I6e5fba7bd273219b1206559420b5bdb78734aa84
Change-Id: I50377746f01749b058c39fd8229f9d566224cc43

4 years agoMerge "Unpack arrays on variadic arguments"
jenkins-bot [Sun, 1 Sep 2019 09:07:02 +0000 (09:07 +0000)]
Merge "Unpack arrays on variadic arguments"

4 years agoMerge "Remove unneeded redeclaration of mPage in Article subclasses"
jenkins-bot [Sun, 1 Sep 2019 09:05:59 +0000 (09:05 +0000)]
Merge "Remove unneeded redeclaration of mPage in Article subclasses"

4 years agoUnpack arrays on variadic arguments
Umherirrender [Sat, 29 Jun 2019 15:17:33 +0000 (17:17 +0200)]
Unpack arrays on variadic arguments

This avoids extra handling in the function to unpack an array

Change-Id: I93277599bc8125e23fca53d43a728fb7e9e39aad

4 years agoRemove unneeded redeclaration of mPage in Article subclasses
Umherirrender [Sat, 29 Jun 2019 14:11:57 +0000 (16:11 +0200)]
Remove unneeded redeclaration of mPage in Article subclasses

It is already set in the parent class

To make phan happy, set the new type with a @property annotation

Change-Id: I47a83e3c4848b0a75284dc08c72df60b3d5dd19b

4 years agoFix method/function names case mismatch in core files
Derick Alangi [Sat, 31 Aug 2019 20:59:45 +0000 (21:59 +0100)]
Fix method/function names case mismatch in core files

PHP doesn't care much but I think we humans do because we should
call methods by the name we give them. Method fixed are;

- isOk() -> isOK()
- setOk() -> setOK()
- teardown() -> tearDown()

Change-Id: I6b3f0cf3902887058efa426968da380803869e0b

4 years agoobjectcache: Optimise array_map in MemcachedBagOStuff::makeKey()
Timo Tijhof [Sat, 31 Aug 2019 21:38:42 +0000 (22:38 +0100)]
objectcache: Optimise array_map in MemcachedBagOStuff::makeKey()

This can get called a lot on an average page load, optimise
a bit by using a referenced foreach iteration instead.

Using a simplified test case, I found this saves about 70% on PHP 7.2.
For 100 iterations, from ~1.5ms to ~0.4 ms.

```lang=php
$args = [ 'FooBar', 'thisthat', 4, 'foo', 12 ];
$left = 100;
foreach ($args as &$arg) {
    $arg = strtr( $arg, ' ', '_' );
    if ( strlen( $arg ) < $left || true ) {
        $arg = '#' . $arg;
    }
    $left--;
}
```

Change-Id: Ie779c4661306a6d3dc08c08671f1a36682ca1afb

4 years agoProxyLookup: Optimise in_array in isConfiguredProxy()
Timo Tijhof [Sat, 31 Aug 2019 21:16:08 +0000 (22:16 +0100)]
ProxyLookup: Optimise in_array in isConfiguredProxy()

This is called on all page loads by WebRequest::getIP(),
from Setup.php.

Strict in_array can easily make it 4 times faster (reduce by 75%).
For example, with an array containing 5 short strings and looking
up a 6th similar string that is not in the list, repeated 100x:

loose:  2.410 ms, 2.731 ms, 2.367 ms
strict: 0.649 ms, 0.668 ms, 0.653 ms

The larger the array to search through, the bigger the difference
becomes as it speeds up each internal comparison.

(PHP 7.2.20)

Bug: T189966
Change-Id: I6742dfa0a6d44b15294695b15ffe4885cb6a5310

4 years agoMerge "jobqueue: Avoid usage of deprecated `MWHttpRequest::factory()`"
jenkins-bot [Sat, 31 Aug 2019 21:09:07 +0000 (21:09 +0000)]
Merge "jobqueue: Avoid usage of deprecated `MWHttpRequest::factory()`"

4 years agoresourceloader: Move mw.user skeleton from startup to base
Timo Tijhof [Wed, 28 Aug 2019 01:17:30 +0000 (02:17 +0100)]
resourceloader: Move mw.user skeleton from startup to base

This isn't required for mw.loader to be able to process the manifest
and fetch modules, so it doesn't need to be shipped there.

Follows-up T192623, in which we didn't notice this.

Similar to 46cd3ed7a7, which moved mw.libs and mw.widgets.

Change-Id: I2d07d8c411d93a6abedd50bf67ca6bf75f93a8c6

4 years agoMerge "phpunit: Don't bother resetting unused global in UploadFromUrlTestSuite"
jenkins-bot [Sat, 31 Aug 2019 20:40:49 +0000 (20:40 +0000)]
Merge "phpunit: Don't bother resetting unused global in UploadFromUrlTestSuite"

4 years agoMerge "maintenance: Remove cross-wiki purging from rebuildmessages.php"
jenkins-bot [Sat, 31 Aug 2019 20:39:05 +0000 (20:39 +0000)]
Merge "maintenance: Remove cross-wiki purging from rebuildmessages.php"

4 years agoMerge "Add ext-dom to composer.json"
jenkins-bot [Sat, 31 Aug 2019 20:38:58 +0000 (20:38 +0000)]
Merge "Add ext-dom to composer.json"

4 years agoMerge "INSTALL/RELEASE-NOTES-1.34: Add required PHP extensions"
jenkins-bot [Sat, 31 Aug 2019 20:17:53 +0000 (20:17 +0000)]
Merge "INSTALL/RELEASE-NOTES-1.34: Add required PHP extensions"

4 years agoAdd $specialPageAliases and $magicWords for Tajik
Amir Aharoni [Tue, 6 Aug 2019 13:44:26 +0000 (16:44 +0300)]
Add $specialPageAliases and $magicWords for Tajik

Contributed by translatewiki user ToJack.

Change-Id: Idada22a2e331c2b8519f961b6ca0e2f02a721681

4 years agoSetup: Remove debug message for "caches"
Timo Tijhof [Sat, 31 Aug 2019 15:33:06 +0000 (16:33 +0100)]
Setup: Remove debug message for "caches"

This is currently forcing more object cache interfaces to be constructed
than might be needed in a given request. The configuration for these
interfaces is usually quite straight forward or can be trivially
verified from eval.php.

If we do want to log this, I would recommend doing it from the classes
constructor instead e.g. something like:

  LoggerFactory::getInstance('MessageCache')->debug( get_class( $cache ) );

Bug: T189966
Change-Id: I06dc6dfbdf274bb57e9295b0c757b8d52c02acbe

4 years agoMerge "lockmanager: sort key by bucket in QuorumLockManager::doLockByType"
jenkins-bot [Sat, 31 Aug 2019 18:00:57 +0000 (18:00 +0000)]
Merge "lockmanager: sort key by bucket in QuorumLockManager::doLockByType"

4 years agoMerge "Optimize HashRing to avoid hashing for the common single-location case"
jenkins-bot [Sat, 31 Aug 2019 17:59:08 +0000 (17:59 +0000)]
Merge "Optimize HashRing to avoid hashing for the common single-location case"

4 years agoMerge "Unsuppress other phan issues (part 4)"
jenkins-bot [Sat, 31 Aug 2019 17:50:09 +0000 (17:50 +0000)]
Merge "Unsuppress other phan issues (part 4)"

4 years agoMerge "Replace unecessary rollbackMasterChangesAndLog() call in doPostOutputShutdown()"
jenkins-bot [Sat, 31 Aug 2019 17:49:55 +0000 (17:49 +0000)]
Merge "Replace unecessary rollbackMasterChangesAndLog() call in doPostOutputShutdown()"

4 years agoMerge "Remove redundant ignore_user_abort() call in ApiStashEdit"
jenkins-bot [Sat, 31 Aug 2019 17:49:49 +0000 (17:49 +0000)]
Merge "Remove redundant ignore_user_abort() call in ApiStashEdit"

4 years agoUnsuppress other phan issues (part 4)
Daimona Eaytoy [Fri, 30 Aug 2019 16:01:28 +0000 (18:01 +0200)]
Unsuppress other phan issues (part 4)

Bug: T231636
Depends-On: I58e67c2b38389df874438deada4239510d21654f
Change-Id: I6e5fba7bd273219b1206559420b5bdb78734aa84

4 years agoUnsuppress more phan issues (part 3)
Daimona Eaytoy [Fri, 30 Aug 2019 13:09:51 +0000 (15:09 +0200)]
Unsuppress more phan issues (part 3)

Bug: T231636
Depends-On: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
Change-Id: I58e67c2b38389df874438deada4239510d21654f

4 years agophpunit: Don't bother resetting unused global in UploadFromUrlTestSuite
Timo Tijhof [Sat, 31 Aug 2019 14:00:29 +0000 (15:00 +0100)]
phpunit: Don't bother resetting unused global in UploadFromUrlTestSuite

messageMemc is not used for anything important. Should be removed
soon, but at least don't reset it in tests. If something new depends
on it, it should fail.

Bug: T189966
Change-Id: Id707db028e6eba03242fc9e1541d785a607d9be9

4 years agomaintenance: Remove cross-wiki purging from rebuildmessages.php
Timo Tijhof [Sat, 31 Aug 2019 13:38:31 +0000 (14:38 +0100)]
maintenance: Remove cross-wiki purging from rebuildmessages.php

This script relied on numerous outdated or unofficial methods that
are no longer supported.

* Global variable $messageMemc holding a BagOStuff based on
  MessageCacheType. This logic is now in ServiceWiring
  for the MessageCache service.

* String "{$db}:messages", should have been using BagOStuff::makeKey()
  and may've fallen out of sync.

* Deleting keys outright instead of touching check keys as
  MessageCache does, since it's been using WANObjectCache for
  several years.

All of this should be done via MessageCache::clear(), but that
can't be easily constructed across wikis on a wiki farm. That
requires instantiating the script for other wikis separately.

Remove support for that, recommending instead that site admins
run it in a loop for each wiki as needed.

Realistically though, that should never be needed. The script has
virtually no known use case, except (as documented in maintenance/README)
"after changing a wiki's content language" - which applies to one
wiki, not all a once.

Change-Id: I9f45d65f5cef93d6e332baf26d955d3f7a7c19d2

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 31 Aug 2019 13:11:56 +0000 (15:11 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I130e7b793e6327e0d1f3b56d0b321f7bb3448c70

4 years agoChange the autonym of Banjar from "Bahasa Banjar" to "Banjar"
Mahuton [Wed, 28 Aug 2019 06:48:27 +0000 (08:48 +0200)]
Change the autonym of Banjar from "Bahasa Banjar" to "Banjar"

Change requested on the Sundanese Wikipedia village pump

Bug: T231283
Change-Id: Ib2f49f77634c497135c0b32256fca4e919866a38

4 years agoChange the autonym of Sunda from "Basa Sunda" to "Sunda"
Mahuton [Wed, 28 Aug 2019 07:22:16 +0000 (09:22 +0200)]
Change the autonym of Sunda from "Basa Sunda" to "Sunda"

Change requested on the Sundanese Wikipedia village pump

Bug: T228832
Change-Id: Id26493395a028b72f0254c7b866eb074eccbe1f9

4 years agoMerge "Use DatabaseBlock instead of deprecated Block in CompositeBlock tests"
jenkins-bot [Sat, 31 Aug 2019 03:34:01 +0000 (03:34 +0000)]
Merge "Use DatabaseBlock instead of deprecated Block in CompositeBlock tests"

4 years agoMerge "user: Hard deprecate `User::addNewUserLogEntryAutoCreate()` method"
jenkins-bot [Fri, 30 Aug 2019 22:50:27 +0000 (22:50 +0000)]
Merge "user: Hard deprecate `User::addNewUserLogEntryAutoCreate()` method"

4 years agoMerge "ContribsPage: Re-remove the getContribs() method"
jenkins-bot [Fri, 30 Aug 2019 22:37:41 +0000 (22:37 +0000)]
Merge "ContribsPage: Re-remove the getContribs() method"

4 years agoMerge "filebackend: fix PhpStorm warnings in FileBackend"
jenkins-bot [Fri, 30 Aug 2019 22:27:11 +0000 (22:27 +0000)]
Merge "filebackend: fix PhpStorm warnings in FileBackend"

4 years agoMerge "MessageFormatterFactory"
jenkins-bot [Fri, 30 Aug 2019 22:12:28 +0000 (22:12 +0000)]
Merge "MessageFormatterFactory"

4 years agouser: Hard deprecate `User::addNewUserLogEntryAutoCreate()` method
Derick Alangi [Tue, 27 Aug 2019 21:43:33 +0000 (22:43 +0100)]
user: Hard deprecate `User::addNewUserLogEntryAutoCreate()` method

This method is no longer used in core or any extension per CS below;

https://codesearch.wmflabs.org/search/?q=addNewUserLogEntryAutoCreate&i=nope&files=&repos=

Change-Id: I906db9a123f6eb4210642b68525324071422eb61

4 years agojobqueue: Avoid usage of deprecated `MWHttpRequest::factory()`
Derick Alangi [Tue, 27 Aug 2019 22:52:38 +0000 (23:52 +0100)]
jobqueue: Avoid usage of deprecated `MWHttpRequest::factory()`

Change-Id: I58c007436d38e4d0edd1ce14034b2f3bfb536df9

4 years agoContribsPage: Re-remove the getContribs() method
DannyS712 [Thu, 29 Aug 2019 20:22:15 +0000 (20:22 +0000)]
ContribsPage: Re-remove the getContribs() method

Dependencies remove the use from Flow and ArticleFeedback.

This reverts commit e6a8e5268d8b70867e58b1c827d42fec56bb315f.

Depends-On: If77a646344b3ee89505bb17be7571f63cff16a5a
Depends-On: I3b2fa1c65cfc32e8ebc21166d32f174557694d88
Bug: T220447
Bug: T231540
Change-Id: I3f87c0310f2f2de674d8c2fa017642bcc69fd834

4 years agoRework ApiUploadTest
Petr Pchelko [Thu, 29 Aug 2019 23:11:04 +0000 (16:11 -0700)]
Rework ApiUploadTest

Bug: T28169
Change-Id: I923bf82d07db0efce1d0d14cf04e15bb58472f59

4 years agoMerge "rdbms: add more ScopedCallback::newScopedIgnoreUserAbort() calls"
jenkins-bot [Fri, 30 Aug 2019 19:42:04 +0000 (19:42 +0000)]
Merge "rdbms: add more ScopedCallback::newScopedIgnoreUserAbort() calls"

4 years agoUse DatabaseBlock instead of deprecated Block in CompositeBlock tests
Thalia [Fri, 30 Aug 2019 18:54:34 +0000 (19:54 +0100)]
Use DatabaseBlock instead of deprecated Block in CompositeBlock tests

Change-Id: I377da7e070ccd4f1ebb4a3e9619833e912180491