Commit graph

96547 commits

Author SHA1 Message Date
Timo Tijhof
5d8f62bdd3 ExtensionRegistry: Remove exporting and caching of wgExtensionCredits
This data is the same as the 'credits' data that is already compiled,
cached and made available via ExtensionRegistry.

Similar to various other configuration variables previously, the
$wgExtensionCredits variable is now also required to only be used
for providing input to the system (e.g. from LocalSettings.php,
or from legacy extension PHP entry points). It is no longer
supported to use this variable to reliably read out a full view
of all extension credits (specifically those registered via
extension.json).

Doing so had the downside of adding processing cost to every
web request, as well as taking one the single largest portion
of the ExtensionRegistry APCu cache key, which in PHP7+ incurs
a linear cost for every string value, string key, of every
(sub)array in this huge structure; and does to on every request
just in case something reads from $wgExtensionCredits.

The new method to access this information reliably is owned
by SpecialVersion for now (could be moved elsewhere). This
also makes the merging logic more testable and incurs it on-demand
rather than upfront.

Details:

* Move 'type' internally from NOT_ATTRIBS to CREDIT_ATTRIBS.
  These two arrays behave identically for most purposes (they are
  both used to mean "don't export this as a global attribute").

  By placing it in CREDIT_ATTRIBS it becomes complete and makes
  it easy to refer to in docs. Previously, extractCredits()
  read the 'type' key outside the loop for CREDIT_ATTRIBS.

* Remove redundant code in ApiBase.php, that is now more obviously
  redundant. Looks like a left-over or merge conflict mistake
  from when ExtensionRegistry was first introduced.

Bug: T187154
Change-Id: I6d66c58fbe57c530f9a43cae504b0d6aa4ffcd0d
2020-05-28 18:46:41 +00:00
Timo Tijhof
d4df7daa3b SpecialVersion: Consolidate internal use of wgExtensionCredits
Rather than each method reading directly from the global,
reduce this exposure to just one method, and pass it down from
there.

This is preparation for the next commit, which will consume
some of this information from ExtensionRegistry instead of
from a global variable.

Bug: T187154
Change-Id: I7d97a4cdc9ff3fe2b0be3b9367c4b783fe7388aa
2020-05-27 22:38:15 +00:00
jenkins-bot
671c98f5ae Merge "Add caption to always suppressing" 2020-05-27 21:00:09 +00:00
jenkins-bot
003b68085b Merge "MediaWikiServices: All logic for services should be in ServiceWiring" 2020-05-27 19:54:58 +00:00
jenkins-bot
ae4049fb6d Merge "Fix impedance mismatch with Parser::fetchCurrentRevisionRecordOfTitle" 2020-05-27 19:21:24 +00:00
jenkins-bot
5373d5722f Merge "Partially revert "Fix impedance mismatch with Parser::getRevisionRecordObject()"" 2020-05-27 19:21:16 +00:00
jenkins-bot
1a5db8c1c5 Merge "Inject SpamChecker where needed, hard deprecate EditPage static methods" 2020-05-27 18:48:58 +00:00
jenkins-bot
005d03f332 Merge "Make EditPage::$hookError private" 2020-05-27 18:48:08 +00:00
jenkins-bot
5249fa5139 Merge "Hard deprecate Revision::getUserText, ::isMinor, and ::isCurrent" 2020-05-27 18:29:50 +00:00
jenkins-bot
81def71fd2 Merge "Improve SidebarBeforeOutput hook doc" 2020-05-27 17:42:42 +00:00
Arlo Breault
938b7234a4 Add caption to always suppressing
In brief, the BlockLevelPass looks at opening and closing tags on a line
to determine whether it should do paragraph wrapping.  The blockElems
want to stop wrapping when opened and start again when closed.  The
antiBlockElems want the opposite, to start when they're opened and stop
when closed.  "table" is a blockElems and "td"|"th" are anitBlockElems
so that content found in the interstitial spaces of tables are never
paragraph wrapped.

That means that, to date, "caption" elements are always found in a place
where paragraph wrapping is always suppressed and so adding them to that
set won't change any test results.  However, a new test is added to spec
out this behaviour.

In the legacy parser, "captions" are always found in the right place
because handleTables runs at an earlier stage.  In Parsoid, however, the
treebuilder is relied on to close table cells [0] so when we get to the
token stream paragraph wrappping pass, "caption"s are found in table
cells and therefore get wrapped, even though the treebuilder is about to
be induced to close the cell before opening the caption.

Therefore, in Parsoid, the fix would require us to make captions always-
suppressing to match the legacy parser behaviour.  Thus, this change
here is just to keep these lists [1] consistent between the two
parsers.

[0] 5e11a3f390/src/Wt2Html/TokenizerUtils.php (L138-L151)
[1] 5e11a3f390/src/Wt2Html/TT/ParagraphWrapper.php (L71-L78)

Bug: T210647
Change-Id: I8ccefd69d47dca740f50924b235dffa3873d1f99
2020-05-27 12:29:59 -04:00
C. Scott Ananian
1113039771 Fix impedance mismatch with Parser::fetchCurrentRevisionRecordOfTitle
This newly-added method returns `false` on error; the caller expects
it to return `null`.

Bug: T253725
Followup-To: If36b35391f7833a1aded8b5a0de706d44187d423
Change-Id: I6af7aeabbba9f95338497026fd08d9ae23f75c22
2020-05-27 12:10:27 -04:00
DannyS712
078972923c MediaWikiServices: All logic for services should be in ServiceWiring
Move handling of the different services that are created with
NameTableStoreFactory to ServiceWiring, so that MediaWikiServices
can just call $this->getService() and nothing else.

For objects created from specs via ObjectFactory, services are retrieved
via ContainerInterface::get( 'ServiceName' ), an alias for ::getService.
Since the different stores created with NameTableStoreFactory were not
individually defined as services, they would not have been usable
with an ObjectFactory spec.

Change-Id: I8f862efeffe91a8ca1c4cbc48a5c429d6c78973c
2020-05-27 15:00:01 +00:00
DannyS712
c45ccd7ca8 Partially revert "Fix impedance mismatch with Parser::getRevisionRecordObject()"
Reason for revert: issue arose again when deployed with wmf.34

Partial revert: keep the intended fix in Parser.php, revert
removal of fail-safe logic in CoreParserFunctions.hp

This reverts commit 2712cb8330.

Bug: T253725
Change-Id: I06266ca8bd29520b2c8f86c430d0f1e2d5dd20c0
2020-05-27 08:10:50 +00:00
Ammar Abdulhamid
b8afc7ee74 Improve SidebarBeforeOutput hook doc
This was changed in I38fa802 to string, which is not correct
Also use 'sidebar' which is more descriptive than 'bar';

Change-Id: I8f0bd444eb648882c489659d08a7fd6898adda57
2020-05-27 07:51:11 +01:00
Translation updater bot
aa6b910b7a Localisation updates from https://translatewiki.net.
Change-Id: I77fadc99ffdf3fefdd3f08869d8367d1d493a70b
2020-05-27 08:47:03 +02:00
jenkins-bot
2f7fbab5ea Merge "Add tests for Hook run call sites" 2020-05-27 03:41:50 +00:00
jenkins-bot
9a2138bccf Merge "Remove USE INDEX user_timestamp or usertext_timestamp" 2020-05-27 00:56:57 +00:00
Reedy
876daaeaf6 Remove USE INDEX user_timestamp or usertext_timestamp
Bug: T253289
Change-Id: Ie3cd3324ccb3b3477085c9037bb9762de33819f4
2020-05-27 00:58:54 +01:00
DannyS712
1e36b2c12f Hard deprecate Revision::getUserText, ::isMinor, and ::isCurrent
Bug: T250579
Bug: T250580
Bug: T250608
Change-Id: I89ac77c436245cad3e746b33aec5a42247fda67d
2020-05-26 22:19:54 +00:00
jenkins-bot
9efef14569 Merge "Remove DifferenceEngine::$mNewRev and $mOldRev" 2020-05-26 21:58:17 +00:00
jenkins-bot
587809dee0 Merge "rdbms: Clarify ILoadBalancer::getConnection doc for when to call reuseConnection" 2020-05-26 21:19:49 +00:00
DannyS712
9571defd8e Remove DifferenceEngine::$mNewRev and $mOldRev
Public access was deprecated in 1.32. Protected access is not
covered under the deprecation policy.

Bug: T250761
Bug: T250714
Bug: T249021
Bug: T250579
Change-Id: I47adbc316236be80672416a5c363a99c3dd53400
2020-05-26 20:51:23 +00:00
jenkins-bot
f11aee48da Merge "CreationHandler: fix redirect URL" 2020-05-26 19:07:43 +00:00
MusikAnimal
9d3254d18e OutputPage: add @internal annotation to addHtmlClasses()
Follow-Up: I4b994e081d9582801fe9d198efd68afc46a14703
Change-Id: I938bfc21d38981c307a87889ef353ddd21a04791
2020-05-26 18:15:02 +00:00
jenkins-bot
5230e822ab Merge "Treat languages and toolbox like other sidebar links" 2020-05-26 17:39:12 +00:00
jenkins-bot
124a049ea2 Merge "Merge htmlform.checker.js into special.userlogin.signup.js module" 2020-05-26 17:39:05 +00:00
jenkins-bot
a122efee1e Merge "Rename mediawiki.special.userlogin.signup.js to mediawiki.special.createaccount" 2020-05-26 17:38:58 +00:00
Derick A
47e41df7ef skins: Drop several usage of deprecated methods now unused
- BaseTemplate::msgWiki() has been removed
- QuickTemplate::msgWiki() has been removed
- Soft deprecated SkinTemplate:getPersonalToolsList() in favor of
  ::makePersonalToolsList().

Change-Id: I20cab798b0334050b9b30171ba99e5bd9503de3b
2020-05-26 09:54:30 -07:00
jenkins-bot
b5012a1e7d Merge "[registration] Remove type of string from Hooks in extension.schema.v1.json" 2020-05-26 16:25:11 +00:00
Marius Hoch
1fbd7276f4 rdbms: Clarify ILoadBalancer::getConnection doc for when to call reuseConnection
This is the behavoir for all known sublcasses (LoadBalancer
and LoadBalancerSingle), as they always resolve the given
$domain to its id (string value), so false no longer has
any special meaning.

Bug: T252019
Bug: T236880
Change-Id: I170a15a035a41af186cdf8a0b88f998df961c554
2020-05-26 16:10:30 +00:00
jenkins-bot
8864b88eaf Merge "Deprecate $wgAutoloadAttemptLowercase and set default to false" 2020-05-26 15:46:12 +00:00
Reedy
2065d76bdb Deprecate $wgAutoloadAttemptLowercase and set default to false
Bug: T231412
Change-Id: I7395c44d4ebf482033a6a4866b3abe484dc3dd70
2020-05-26 14:18:01 +01:00
Reedy
229b2c15e8 Fix a plethora of class and function call case mismatches
Bug: T231412
Change-Id: I597a25de3294a6673424f30475760280ef209a8a
2020-05-26 14:14:46 +01:00
jenkins-bot
111ae6400d Merge "auth: Add helpful type hint to AuthManager" 2020-05-26 11:00:58 +00:00
jenkins-bot
9d1bd65aa2 Merge "REST Handler: add unit tests for base class" 2020-05-26 10:53:00 +00:00
DannyS712
7a120179d2 Make EditPage::$hookError private
Unused outside of the EditPage class within deployed code, keeping it
public will prevent efforts to factor out a backend by maintaining
reliance on an EditPage object.

Bug: T252907
Change-Id: Ic9c95da636b05c5de15bf968ebe35586497d736e
2020-05-26 10:40:29 +00:00
daniel
ad6879e6b6 REST Handler: add unit tests for base class
This adds unit tests for the Handler base class.

This includes tests for public and protected methods.
Since the Handler base class is an extension point, the protected methods
are part of the stable public interface.

Change-Id: Ibe9fcbb139683dad03b92cd0618c3c0e8feb8b94
2020-05-26 10:33:36 +00:00
DannyS712
35c0518959 Inject SpamChecker where needed, hard deprecate EditPage static methods
Bug: T251015
Change-Id: I2df950d5ac9a7fc342409f778d7f9c2418cdd7af
2020-05-26 03:17:29 -07:00
jenkins-bot
4602f8db2d Merge "Disable parsing of prefs-memberingroups message" 2020-05-26 06:47:15 +00:00
jenkins-bot
1a856ed34d Merge "Localisation updates from https://translatewiki.net." 2020-05-26 06:35:50 +00:00
Translation updater bot
e51ce95e23 Localisation updates from https://translatewiki.net.
Change-Id: I0535d1f09649d52bc32d31a29dcfcd0c7534673a
2020-05-26 08:34:09 +02:00
jenkins-bot
f422d261a5 Merge "Fix version number not showing in NoLocalSettings.php" 2020-05-26 06:29:33 +00:00
jenkins-bot
c212b333fd Merge "Xml dumps should not die when the page redirect target cannot be determined" 2020-05-26 03:08:42 +00:00
jenkins-bot
8cbb8cefd7 Merge "Broaden parameter types in BlockIpCompleteHook" 2020-05-26 01:37:50 +00:00
Tim Starling
a302833fc3 Broaden parameter types in BlockIpCompleteHook
maintenance/blockUsers.php calls the hook with the result of
User::getBlock(), which is an AbstractBlock. So change the parameter
types from DatabaseBlock to AbstractBlock. This allows phan to pass.

Change-Id: I89f9aa87ec9a5f16133f43c2816f6b3441e5b102
2020-05-26 10:54:44 +10:00
jenkins-bot
29fbda6260 Merge "Extension schema updates for HookContainer" 2020-05-26 00:46:33 +00:00
Reedy
583602e16d [registration] Remove type of string from Hooks in extension.schema.v1.json
Same as it will be or v2 when that patch merges

Change-Id: I64c3bbcda0f353fe9c14b0d5bea241e0304c0e2e
Follows-Up: I1a8657ff9fd14618c6709dbab62c3b4ee9f659a5
2020-05-26 01:28:49 +01:00
Bartosz Dziewoński
124f0a3f97 Fix version number not showing in NoLocalSettings.php
Change-Id: I19b912149c31ae52bc01f4544696e45dd0962e60
2020-05-26 02:14:10 +02:00
Aaron Schulz
58c94afe2e filerepo: make ForeignDBRepo::getSharedKey() use the DB domain ID for consistency
Follows-up 96ad0db6b4 and 88e17d3f7c.

Change-Id: I5e3163e54006b35792a82264905c637b187d25dd
2020-05-25 20:54:39 +00:00