Commit graph

3650 commits

Author SHA1 Message Date
jenkins-bot
f747241182 Merge "Remove &$references from $wgAutopromote in DefaultSettings" 2022-03-11 22:33:28 +00:00
daniel
b0cbb9b8ba Remove &$references from $wgAutopromote in DefaultSettings
If we want to convert DefaultSettings to a schema, we can't use variable
references.

Change-Id: Ia53cf45f7f029e1ba4191324005fef25055d5296
2022-03-11 21:38:27 +00:00
daniel
c3b3afa519 Remove conditional initialized from DefaultSettings.php
If we want to turn DefaultSettings into a schema, we can't have
conditionals in there.

$wgCommandLineMode is already initialized in Setup.php, line 136:

  // Set $wgCommandLineMode to false if it wasn't set to true.
  $wgCommandLineMode = $wgCommandLineMode ?: false;

Change-Id: Ib5302bfa36a218611eec6395f90434960bed336c
2022-03-11 10:51:35 +01:00
James D. Forrester
26109fb098 logos: Set default install icon to be an SVG one
Change-Id: I5cd715a0c220667827cde99f0296280110c78631
2022-03-10 12:54:59 -05:00
jenkins-bot
65ba7e2560 Merge "Allow the user to set a default number of search results" 2022-03-09 20:13:45 +00:00
jenkins-bot
e663e2b14e Merge "rcfeed: Deprecate $wgRCEngines and RCFeedEngine" 2022-03-08 21:59:40 +00:00
jenkins-bot
057d3b6358 Merge "Deprecate the ParserOutputHook functionality" 2022-03-08 21:38:43 +00:00
Timo Tijhof
f8ecea1e5c rcfeed: Deprecate $wgRCEngines and RCFeedEngine
Follows-up 39a6e3dc4d (I8be497c623c5d92).

* Improve documentation all around and advertise 'class'
  everywhere instead of 'uri'.

* Add test coverage for RCFeed::factory().

* Deprecate the $wgRCEngines "uri to class" mapping in favour
  of specifying "class" directly in $wgRCFeeds.

* Deprecate RCFeedEngine in favour of FormattedRCFeed.
  Convert to class_alias so that UDPRCFeedEngine no longer has
  to extend the deprecated class name explicitly (for instanceof compat).

* Hard-deprecate RecentChange::getEngine.

Bug: T250628
Depends-On: Ie939e1d06b9ee2d841ec7256c8d24cc4e7e386dd
Change-Id: Ib6758d724c7200404c89c7ab157aa55f1cad9763
2022-03-08 19:50:19 +00:00
jenkins-bot
277453fe78 Merge "Define MW_INSTALL_PATH constant and BaseDirectory config." 2022-03-08 17:44:09 +00:00
jenkins-bot
347275f940 Merge "Add configuration for write both on templatelinks table" 2022-03-08 16:15:57 +00:00
Reedy
396534681b DefaultSettings.php: Add example for $wgSkinMetaTags
Change-Id: I722f112d96f0abb244240e4ba422a8c46d5eb64d
2022-03-08 02:06:43 +00:00
C. Scott Ananian
773801e439 Deprecate the ParserOutputHook functionality
These hooks should be implemented in the OutputPageParserOutput hook
instead.

Bug: T292321
Change-Id: Ib6f457596ea9d193bc03e15a48f135db4f4a6b27
2022-03-07 16:56:10 -05:00
Reedy
11cc2d6993 Consistently use @deprecated since rather @deprecated
Change-Id: I301786f35cd6eb9c63fb72e0b64cffa9efd7b86b
2022-03-06 02:55:54 +00:00
daniel
cf581bb2ca Define MW_INSTALL_PATH constant and BaseDirectory config.
Application logic should use the BaseDirectory config variable.
Framework code should use MW_INSTALL_PATH to locate files should.

NOTE: Update https://www.mediawiki.org/wiki/Manual:$IP

Bug: T300301
Depends-On: I7142af16d692f26e90673b058029f572c1ea3991
Change-Id: Ib4caa80bb7007c4c7960a2fd370cf5da7d9ba344
2022-03-04 14:18:27 +01:00
daniel
f31bc32a65 Remove deprecated alias $wgStyleSheetPath
$wgStyleSheetPath has been a deprecated alias for $wgStylePath since 1.3 (2004).
Time to get rid of it.

Change-Id: I78a6394003b9aefab7aa8559b8e2b22bc50154fc
2022-03-04 13:36:56 +01:00
Amir Sarabadani
f7298b59b8 Add configuration for write both on templatelinks table
Bug: T299419
Change-Id: Ic288ba021eecbed438e9337e52a41c59a89b6a9b
2022-03-03 08:48:13 +01:00
Matthias Mullie
b0bd09c939 Remove change tags for media additions/removals
This reverts commit dab7b16741.

Reason for revert: This was inaccurate/incomplete &
looks like we will not need this after all

Bug: T286362
Change-Id: I6d63d69f180d193f99986ce6878617d63cfb2b6d
2022-02-28 11:08:09 +01:00
Alan Thomas
f003b125ba Allow the user to set a default number of search results
Bug: T215716
Change-Id: I2b355f7830b24f7353a7e7f9e102d5be77b534d6
2022-02-20 22:09:47 +11:00
daniel
0ebf7786b1 DeferredUpdates: Introduce $wgForceDeferredUpdatesPreSend
Enabling this setting will cause post-send deferred updates to be run
before a response is sent to the client, so the client can observe all
effects of their last request immediately.

This resolves a problem with some end-to-end tests that were failing
because the updates caused by one request had not landed in the database
by the time the subsequent request was made.

This patch re-enabled some e2e tests that were disabled because of this
problem. If $wgForceDeferredUpdatesPreSend works as intended, the tests
should again pass reliably.

Bug: T230211
Bug: T301100
Change-Id: I0e30fdb6acba85cec4bb1499f7063ba6bfb0ffb2
2022-02-15 19:49:14 +01:00
Tim Starling
e582572622 Improve ObjectCache integration tests
* Add BagOStuffTest subclasses for all core BagOStuff subclasses,
  replacing PHPUNIT_USE_BAGOSTUFF, as suggested in a todo comment.
* Add config $wgEnableRemoteBagOStuffTests which causes all tests
  enabled by $wgObjectCache to execute, which means that the memcached
  tests are executed by default.

I have verified all except RESTBagOStuff and WinCacheBagOStuff. The
memcached tests fail against memcached 1.5.x but pass against memcached
1.6.x.

Bug: T90875
Change-Id: Id74b5226669f8cb857f859fbc35bc58ab001e873
2022-02-11 10:20:33 +11:00
Tim Starling
b90d2dd5c2 Optimise Skin::getLanguages()
Skin::getLanguages() was consuming 4% of index.php CPU time. In local
testing, it was called three times per page view. So:

* Memoize it, analogous to the nonfunctional code in SkinVector.
* Simplify ClassicInterwikiLookup by removing the option to pass a CDB
  file path. This was only ever supported by a WikimediaMaintenance
  script. In the unlikely event that someone is using this feature, they
  have the same motivation to switch to PHP as we did in T122362.
* Increase the size of ClassicInterwikiLookup's MapCacheLRU from 100 to
  1000. This helps greatly in the case when $wgInterwikiCache is false
  and more than 100 interwikis are requested and seems harmless
  otherwise.
* Optimise Title::getNsText() by assuming that the canonical name of
  NS_MAIN is the empty string.
* Rearrange Message::__construct() to avoid duplicate type checks.

Change-Id: I736cb74efc267fd2473a3267471735238217251c
2022-02-08 22:34:15 +00:00
daniel
f5641f9856 Do not rely on $IP in DefaultSettings.php
In order to allow configuration default to come from JsonSchema,
and dynamic defaults need to be initialized in Setup.php.

This movesd the initialialization of $wgExtensionDirectory and $wgStyleDirectory
to Setup.php

Bug: T294788
Change-Id: I11f5723aa299caa210cf6a1f5b7436f191b1ffc2
2022-02-03 22:05:34 +00:00
jenkins-bot
91e4fc00ca Merge "HttpRequestFactory: allow 0 to mean no max timeout." 2022-01-31 15:31:23 +00:00
Timo Tijhof
1bb26ce403 Metrics: Fix typo in wgMetricsPrefix docs
Follows-up Id022e62e881bdc.

Change-Id: I0c53461dcfc90b53e379b8277c079188b73566af
2022-01-30 03:53:18 +00:00
jenkins-bot
b18023b48f Merge "filerepo: Simplify and document 'favicon' FileRepo option" 2022-01-28 18:14:28 +00:00
daniel
d599a54e5f HttpRequestFactory: allow 0 to mean no max timeout.
$wgHTTPMaxTimeout and $wgHTTPMaxConnectTimeout used to default to INF,
the positive infinity float value. This value has no representation in
JSON. In order to allow default configuration values to be defined in
a JsonSchema, we allow 0 to be used to represent "no limit" instead.

Bug: T294788
Change-Id: Id1b832b46ac6984655dcf0c06d5af7d356cca800
2022-01-28 18:40:03 +01:00
bwang
0dcbe84184 Update skin ordering to prioritize skins set through a new config
Bug: T298933
Change-Id: Ic957421617b519bd8160be475ac538b0944a8da9
2022-01-26 23:59:41 +00:00
Timo Tijhof
77b7cbc462 filerepo: Simplify and document 'favicon' FileRepo option
This was originally added in changes linked to T77093 without
coordination with maintainers and took various shortcuts and lacked
proper integration.

* Rather than reading a global variable from LocalRepo::getInfo,
  inject this option from Setup.php, the same as for other local
  settings.

* Apply the wfExpandUrl() call in the base class getInfo() method.

  This is done so that $wgForeignFileRepos and $wgLocalFileRepo
  settings via LocalSettings.php or wmf-config get the same treatment
  and benefit (support for paths) as $wgFavicon, which one would
  generally expect.

  Other reasons to do this at run-time are 1) We can't safely call
  wfExpandUrl() during Setup.php as it is too early, and 2) We generally
  avoid doing computational work during Setup.php given it's not
  needed for most web requests to most entry points (T189966, etc.).

* Document the option in DefaultSettings.php.

* Fix bad doc in FileRepo.php, to reflect that it is optional
  and may be null.

* Remove now-redundant hack in ForeignDBRepo::getInfo,
  which had to jump over its parent class previously to avoid
  inheriting the other hack in LocalRepo::getInfo, which is now
  gone as well.

Bug: T77093
Change-Id: I9102b5a246ff81a3435748a3fd1c759a4b884a51
2022-01-26 19:27:35 +00:00
Timo Tijhof
f1a57aac7e Metrics: Minor doc improvements and announce feature in release notes
- Make order of the config consistent.
 - Change the default config for format to 'null'.

Bug: T240685
Change-Id: Id022e62e881bdc7c4896ba070ed2b0ad47b25c74
2022-01-20 17:25:30 +00:00
Tim Starling
198ac323ba Increase template depth limit to 100
* Update the comment about xdebug recursion depth. The default of
  xdebug.max_nesting_level is now 256.
* Increase the two parser template expansion depth limits from 40 to
  100. These limits were never really about CPU time, and there's less
  concern about stack size now that PHP uses a virtual stack allocated
  on the heap. The use case on the linked bug is pretty harmless.

Bug: T293546
Change-Id: I0e394f7820b8fd3549911cfec3e079991b234779
2022-01-14 14:08:02 +11:00
Ammarpad
0cb005379e Remove experimental $wgUseCategoryBrowser and code
This experimental feature never gain traction and
T35614 seems to show it has unresolved bug since
introduction.

Bug: T298553
Change-Id: I0924930b6730102ac31caa29f443a202490cc8c5
2022-01-11 21:05:01 +00:00
jenkins-bot
fb80b943b6 Merge "Write to multiple categorylinks tables on update" 2022-01-10 18:34:25 +00:00
Timo Tijhof
009f224ec1 resourceloader: Allow debug=2 on JavaScriptTest, and misc whitespace
* Use the int result of `ResourceLoader::inDebugMode()` directly in
  SpecialJavaScriptTest so that debug=2 is passed on to the next
  request, like it does on regular page views.

  This is likely temporary, because
  part of T85805 is to make debug=true default to debug=2, and
  part of T250045 is to hardcode debug=2 for JavaScriptTest.

* Add a few line breaks to improve HTML output readability in debug
  mode. This is a no-op for prod as they get minified away.

  Today I learned: PHP string heredoc and nowdoc syntax strip not
  only the shared common indentation (which I knew), it also strips
  the first and last newline. Hence, switching ClientHtml to use
  double quotes.

* Document the order in which lang/skin/debugScripts execute.

Bug: T85805
Bug: T250045
Change-Id: I2ad179401cee6cf6ba30c0b462f0d48a8529ba74
2022-01-06 19:03:27 +00:00
Timo Tijhof
64febce451 resourceloader: Improve wgResourceLoaderMaxage docs, minor clean up
The docs for wgResourceLoaderMaxage still described the "server"
and "client" subkeys, which have not existed since MW 1.35. This
was essentially a new configuration structure, add the `@since`
annotation to reflect this.

Clean up the ResourceLoader class and group together related class
members in a more logical way. Currently going for what I see various
other core components do:

* Constants: public, then private.
* Static: public, then private.
* Members: public (none), then ctor-assigned/injected stuff, then
  those with defaults that start as-is.

Make most protected members private, except for those intentionally
made protected for use in tests. This class is not meant to be
extended, is not marked as stable for that purpose, and Codesearch
shows no extensions that do so.

Remove unused internal '$testModuleNames' field. This was removed in
5f47d994bc and accidentally reintroduced (unused) with 440dfcf6d8,
presumably due to a bad rebase.

Bug: T32956
Change-Id: I041a320d05c9e5f30ac9cc9270ce82c4d19a957f
2022-01-06 18:52:45 +00:00
Tim Starling
1aecb692f6 Write to multiple categorylinks tables on update
Add $wgTempCategoryCollations which tells LinksUpdate to write to
additional tables similar to categorylinks, except that the additional
tables have a custom collation.

This is supposed to be used with RemoteIcuCollation to ease migration to
a different version of ICU.

Bug: T263437
Change-Id: Id340d2213cc22115eda5d26f010b5287bd3796cf
2022-01-04 15:35:57 +11:00
jenkins-bot
fd3020b8cd Merge "Allow setting max execution time to several special pages" 2021-12-16 01:54:31 +00:00
Amir Sarabadani
627c1c2c30 Allow setting max execution time to several special pages
These special pages and their counter-part APIs are:
 - Special:RecentChanges
 - Special:Watchlist
 - Special:Log
 - Special:Contributions

This also changes the way MAX_EXECUTION_TIME works from taking the value
as milliseconds, it takes seconds which is more intuitive for users.

Bug: T297708
Depends-On: I126e7181422d8da1a63afc3717faa4f72a687dd9
Change-Id: I3ff78751c3df3b6342f1865d35c2075f4415185d
2021-12-15 22:59:06 +01:00
jenkins-bot
c0e00b43bd Merge "externalstore: Improve overall documentation" 2021-12-15 05:27:48 +00:00
Timo Tijhof
f21caa41d3 externalstore: Improve overall documentation
* Consolidate various duplicate docs to the main entry point.
  Especially the duplication that followed after ExternalStoreFactory
  and ExternalStoreAccess were introduced with ExternalStore
  left as deprecated wrapper.

* Officially mark ExternalStoreFactory as internal, pointing
  to ExternalStoreAccess instead. And document why the latter exists,
  since it seems all its methods could trivially move to the factory
  class. Follows-up I40c3b553, where it was explained that the factory
  is meant to be an internal implementation detail, with the access
  class meant to resemble ExternalStoreMedium.

* Use consistent terms for "protocol", "location" and "object"
  (reduce use of words like medium, backend, type, blob, revision,
  etc. within this code).

* Document that ExternalStore is fundamentally designed as an
  append-only store (per T247383).

Bug: T247383
Change-Id: I1094af7d35a14f9e47b8791f3e4cc888e8cbfc7f
2021-12-15 02:03:47 +00:00
jdlrobson
e3c0032f22 Add SpecialPage::newSearchPage to replace Skin::setSearchPageTitle
The new method takes into account user preferences to obtain
the search page preferred by the user.

This is an API driven preference, that extensions can set.

It has been made backwards compatible with Extension:MediaSearch
which will first need to make use of the new preference and update
existing user's preferences

Bug: T295616
Change-Id: I6f0daf0bac4fc10798c12f066df6fd30fe4eebd0
2021-12-10 20:09:24 +00:00
jenkins-bot
ec797e8b30 Merge "Deprecate $wgAjaxUploadDestCheck, act as always-true" 2021-12-09 16:19:04 +00:00
Kunal Mehta
6f01b0d007 Support having groups inherit permissions from another group
There are common use cases to having a group inherit permissions from
another group. For example, if you have to have a "confirmed" group that
can be manually handed out to grant "autoconfirmed" status, or if you
wanted to make the "sysop" group also have "interface-admin" powers.

Previously to make this work you needed to either copy all the
$wgGroupPermission entries for the second group, or use a
$wgExtensionFunctions to copy it over at runtime. Neither are great
solutions, hence this patch.

This introduces a new configuration option, $wgGroupInheritsPermissions,
that GroupPermissionsLookup will use when determining what permissions
each group has. This option is not recursive for simplicity.

To make this work, Special:ListGroupRights now consults
GroupPermissionsLookup instead of looking at the
$wgGroupPermissions/$wgRevokePermissions globals. It also uses
UserGroupManager to get the list of all groups instead of looking at
more globals.

Anything still directly reading permissions from those globals is liable
to be broken, if they weren't already.

Bug: T275334
Change-Id: Iad72e126d2708012e1e403bee066b3017c16226d
2021-12-04 12:45:23 -08:00
Amir Sarabadani
9bcd3fdfa5 Remove ActionAjax
Bug: T42786
Change-Id: I8bda0c281e1f4abbffbddb80ac74a6d61a034d28
2021-12-01 22:31:30 +01:00
Reedy
2a2bb1e9bd Remove or replace usages of "sane"
Bug: T254646
Change-Id: I096b2cf738a1395a14f1d47bcbed0c2c686c2581
2021-11-22 13:35:17 +00:00
jenkins-bot
5015cc1292 Merge "registration: Fix typo in wgExtensionInfoMTime docs example" 2021-11-18 22:24:31 +00:00
Timo Tijhof
e229cc12f2 registration: Fix typo in wgExtensionInfoMTime docs example
Change-Id: I5e580a2c798693e98ddcb94375ae8502163f7100
2021-11-18 21:56:20 +00:00
Alexander Vorwerk
296b485d9a Add deprecation warnings to wfLogProfilingData()
The logic has been moved to the MediaWiki class in If78c37046cf86.

Bug: T292269
Bug: T292253
Change-Id: I563c6529fc045c2ce3c2d67ba17ae31a388901dd
2021-11-17 21:58:45 +00:00
Ladsgroup
8c4898d6be Revert "media: Port DjVuImage::retrieveMetaData() to use BoxedCommand"
This reverts commit 9834e56f38.

Reason for revert: Does not work in production (CLI mode)

Change-Id: Ibcbaeb83a3682bdcba167a1d5d5a1b8efb89ee75
2021-11-15 13:57:11 +01:00
Yuki Shira
15563022cf DjVu: Update @since tag from 1.37 to 1.38 for $wgDjvuShell
Follow-Up: Ic4e3dff246792692a952da0e8f9b4a83d1b6b963

Change-Id: I27fd8dab883867e99d9061067151241231e42280
2021-11-11 00:22:07 +00:00
jenkins-bot
d132545236 Merge "resourceloader: Fix indent in ResourceModules docs for "es6" option" 2021-11-10 21:20:26 +00:00