lhc/web/wiklou.git
4 years agoMerge "EditPage: Don't set 'hookaborted' error if the hook set a better error"
jenkins-bot [Wed, 4 Sep 2019 15:27:44 +0000 (15:27 +0000)]
Merge "EditPage: Don't set 'hookaborted' error if the hook set a better error"

4 years agoMerge "ApiBase: Always validate that 'limit' is numeric"
jenkins-bot [Wed, 4 Sep 2019 15:15:43 +0000 (15:15 +0000)]
Merge "ApiBase: Always validate that 'limit' is numeric"

4 years agoMerge "Include change tags in revision import structure"
jenkins-bot [Wed, 4 Sep 2019 09:46:56 +0000 (09:46 +0000)]
Merge "Include change tags in revision import structure"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 4 Sep 2019 07:10:01 +0000 (09:10 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1f3f259b07e4b7bd6ccd305af12fb8e9400a7407

4 years agoMerge "Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback"
jenkins-bot [Wed, 4 Sep 2019 03:00:09 +0000 (03:00 +0000)]
Merge "Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback"

4 years agoUnsuppress phan issues, part 8
Daimona Eaytoy [Sun, 1 Sep 2019 12:45:11 +0000 (14:45 +0200)]
Unsuppress phan issues, part 8

And also clean up the config.

Bug: T231636
Depends-On: Ie6233561de78457cae5e4e44e220feec2d1272d8
Change-Id: I82a279e1f7b0fdefd3bb712e46c7d0665429d065

4 years agoMerge "Fix PhpStorm IDE warnings in ServiceWiring.php"
jenkins-bot [Wed, 4 Sep 2019 00:03:39 +0000 (00:03 +0000)]
Merge "Fix PhpStorm IDE warnings in ServiceWiring.php"

4 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Tue, 3 Sep 2019 23:24:57 +0000 (23:24 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoFix PhpStorm IDE warnings in ServiceWiring.php
Aaron Schulz [Thu, 29 Aug 2019 04:50:12 +0000 (21:50 -0700)]
Fix PhpStorm IDE warnings in ServiceWiring.php

Change-Id: Ic1352311908a08a19346ebbee5f5ce73db7633f3

4 years agoApiBase: Always validate that 'limit' is numeric
Bartosz Dziewoński [Fri, 30 Aug 2019 17:21:34 +0000 (19:21 +0200)]
ApiBase: Always validate that 'limit' is numeric

Bug: T231582
Change-Id: I956d4d623bfeace1b542039283e04a970fd40121

4 years agoMerge "resourceloader: Compile documentElement.className server-side"
jenkins-bot [Tue, 3 Sep 2019 21:04:23 +0000 (21:04 +0000)]
Merge "resourceloader: Compile documentElement.className server-side"

4 years agoMerge "resourceloader: Reduce width of module hash from 7 chars to 5"
jenkins-bot [Tue, 3 Sep 2019 19:21:39 +0000 (19:21 +0000)]
Merge "resourceloader: Reduce width of module hash from 7 chars to 5"

4 years agoInclude change tags in revision import structure
Adam Wight [Thu, 22 Aug 2019 13:11:11 +0000 (15:11 +0200)]
Include change tags in revision import structure

This makes it possible to import change tags, which will be leveraged by
Extension:FileImporter.

Bug: T227849
Change-Id: I70a8df2b2be0ec11806eb8d798115c52683cc787

4 years agoMerge "WebRequest: Optimise WebRequest::getPathInfo()"
jenkins-bot [Tue, 3 Sep 2019 19:01:00 +0000 (19:01 +0000)]
Merge "WebRequest: Optimise WebRequest::getPathInfo()"

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 agoWebRequest: Optimise WebRequest::getPathInfo()
Timo Tijhof [Mon, 2 Sep 2019 01:03:02 +0000 (02:03 +0100)]
WebRequest: Optimise WebRequest::getPathInfo()

Called for all PHP web requests from WebStart.php via
WebRequest::interpolateTitle.

* Use isset() instead of empty() where we only need to check
  that the key is supported.

* Don't import global `$wgUsePathInfo` in the common case.

* Migrate from deprecated wrapper Wikimedia\suppressWarnings
  to AtEase::suppressWarnings.

* Use strpos() instead of preg_match(). Consistently faster,
  albeit not by much (for 100 iterations: 0.04ms vs 0.23ms).

* Don't create unused $matches array for the common case.

Bug: T189966
Change-Id: I0de126953c25f3629cb85a0d4e46598baf261c15

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 agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 3 Sep 2019 07:34:55 +0000 (09:34 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib8d7da32b31673e1c96b5ecb1f66eac8220217e4

4 years agoRemove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback
Aaron Schulz [Sun, 1 Sep 2019 16:57:51 +0000 (09:57 -0700)]
Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback

Also make sure the result is a string as is required

Change-Id: I90107efd8f253aebc9b83fc2272aedf65ba161ba

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 agoresourceloader: Reduce width of module hash from 7 chars to 5
Timo Tijhof [Mon, 29 Jul 2019 16:15:23 +0000 (17:15 +0100)]
resourceloader: Reduce width of module hash from 7 chars to 5

In a nut shell:

* We very often (52% of modules on enwiki) pad the hash with a zero,
  which means the amount of bits we currently compute already fit in
  6 characters already for most modules. For some modules (3%) we
  even padded two zeroes.

* For the (now documented) use cases, the space of 78 Giga
  (78 billion, or 78 milliard) seems more than we need. The space of
  60 million should be enough.

  This follows-up dfd046412f from 2016, which previously shortened the hash
  down from 8 chars of base 64 (or 12 chars of hex) to 7 chars of base 32.
  Before that change, the space was 281 Tera (64^8, or 16^12).

For more details see the added inline comment for ResourceLoader::makeHash,
and also the data at <https://phabricator.wikimedia.org/T229245>.

Bug: T229245
Change-Id: I9ad11772a33b3a44cb625275b1d7353e1393ee49

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"