Commit graph

3393 commits

Author SHA1 Message Date
Timo Tijhof
dfbe91e03b filerepo: Improve $wgLocalFileRepo docs
* Move 'hashLevels' docs from $wgHashedUploadDirectory to $wgLocalFileRepo.

* Add docs for the 'deletedHashLevels' option.

* Cross-reference between LocalRepo constructor and $wgLocalFileRepo
  so that its option docs can be more easily found.

* Remove the TODO for deprecating 'hashLevels' per T199590.

Change-Id: I19c28fd0c2fb937608963fe0643607b07af69c70
2020-04-18 16:04:49 +01:00
Thiemo Kreuz
5d5436e4cb jobs: Rewrite non-standard CategoryMembershipChangeJob constructor
I'm not sure what the benefit was of having this service being injectible
via the constructor. I mean, I wish *all* services would be injected. But
there are more services used in this class, and no other is injected.
Also it seems the only test that was ever setting the ParserCache service
to something else was not even using it: As far as I can see the test
case testJobSpecRemovesDuplicates() is not triggering the code that uses
the ParserCache service.

Change-Id: I65f5c654d36ffecfd914e97cd8069eb99f76c5c6
2020-04-17 15:48:25 +02:00
C. Scott Ananian
a286a59e86 Deprecate $wgParserConf
This setting has been effectively constant since 2008.  In modern code
we should be using a ParserFactory instead to customize Parser creation
and not calling the Parser constructor directly (T236811).

Because the ParserFactory is cached, which freezes the current value of
the content language and other options, we need to reset the ParserFactory
object when running parser tests (T248977).  Thanks to
Peter Ovchyn <peter.ovchyn@speedandfunction.com> for first uncovering this
issue and suggesting a fix in I4203bf7719a8555a09b72cdb5b1ae7a6e1505acf.

Code search:
https://codesearch.wmflabs.org/deployed/?q=wgParserConf&i=nope&files=&repos=
https://codesearch.wmflabs.org/deployed/?q=ParserConf&i=nope&files=&repos=

Bug: T248977
Bug: T236811
Depends-On: I97d58750c91b06eeca5d810509becdf53a39cc95
Depends-On: Idf59cd54146d31c1c32883f4318e6a0bf60e1a8a
Change-Id: I787f22ea9bf59a049b13631ba6974866a1300988
2020-04-16 15:57:37 -04:00
jenkins-bot
314bc27378 Merge "language: Remove maintenance/language/transstat.php" 2020-04-16 17:04:39 +00:00
Thiemo Kreuz
4ddb1fc8a4 jobs: Unify a few not matching job constructor signatures
According to \Job::factory() it's not possible for any of the
parameters to be optional. The first is always a Title object, the
second is always an array.

For classes implementing GenericParameterJob the $title parameter is
gone and replaced with a 'title' element in the array. Same here:
the array is not optional.

Change-Id: Idb4ae2f5fb500956b156710dcfe623802c274a3e
2020-04-16 16:07:30 +02:00
Niklas Laxström
e19f4e16a6 language: Remove maintenance/language/transstat.php
https://www.mediawiki.org/wiki/Localisation_statistics hasn't been
updated since 2015. Translatewiki.net provides up to date stats.

Change-Id: I6f9902219edb63c2df08b1e1d70826cfc3531057
2020-04-16 11:39:30 +02:00
James D. Forrester
3dc416d472 Stop defining legacy 'rows' and 'cols' options, ignored since MW 1.29
Bug: T155153
Change-Id: I5f5bc6d903513e89281ee8063ca456f105e24cce
2020-04-14 04:09:43 +00:00
jenkins-bot
1c0976e331 Merge "OutputPage: Add experimental preconnect resource hint for thumbnails" 2020-04-07 21:19:47 +00:00
Dave Pifke
0a3aa08b72 OutputPage: Add experimental preconnect resource hint for thumbnails
Adds <link rel="preconnect"> for the first valid foreign or local file
repo, on pages containing images.

This is a hint to the browser that it should open a connection to the
other host (e.g. upload.wikimedia.org), if it doesn't have one
already.  Doing so allows the connection setup to happen before page
parsing is complete, and should result in faster image loading,
especially on slow connections.

Bug: T123582
Change-Id: I2dcc14f05012570a3e41ed8c7064969a4cbfb6db
2020-04-07 21:04:47 +00:00
daniel
02162e823c Use XML dump schema version 0.11 for new installs.
Bug: T238921
Change-Id: I144fdae3311171229f6e4df542441731fe688c1a
2020-04-07 12:42:26 +00:00
jenkins-bot
dae01cdbec Merge "Allow whitelisting custom headers in action API CORS logic" 2020-04-03 21:18:31 +00:00
Gergő Tisza
0ed077d3fc
Allow whitelisting custom headers in action API CORS logic
Bug: T249107
Change-Id: I622e4b956cd839c9d4375e1ef8f695d635a0d767
2020-04-03 22:30:11 +02:00
jenkins-bot
0e74c1b031 Merge "objectcache: Improve wgMainWANCache docs" 2020-04-03 16:08:36 +00:00
Timo Tijhof
c7330ebabc objectcache: Improve wgMainWANCache docs
* Document how wgWANObjectCaches and wgMainWANCache are
  used / should be used.
  Remove outdated mention of event relayers.

* The easiest way I could document the 'other' options that
  wgWANObjectCaches entries can have was by saying which keys
  can't be set and that aside from these and class/cacheId
  they are all passed on.

  However, that wasn't (yet) technically right given we do pass
  class/cacheId on blindly, which might be unexpected for
  subclasses in theory. Explicitly unset those in ServiceWiring
  to avoid any chance of confusion. Also simplify that code
  slightly overall in terms of var names and var re-use,
  and improve error messages a litle bit.

* Test plan for the wanobjectcache-deployment doc ref:

  $ php maintenance/mwdocgen.php \
   --file includes/DefaultSettings.php,includes/libs/objectcache/

  Then open path/to/mediawiki/docs/html/, click on the docs for
  DefaultSettings, and find-in-page to "wgMainWANCache".

Change-Id: I1cfc65c2cc4dbceed6b9777c2b808527a58daeb9
2020-04-02 20:11:20 +00:00
jenkins-bot
6c0a0405b8 Merge "Fix docs for $wgRCFeeds" 2020-04-02 01:47:32 +00:00
Brad Jorsch
65af695018 Fix docs for $wgRCFeeds
Doxygen's @example is intended for referring to a code file that
contains example code, not for embedding examples inside a doc comment.

@code seems like the best option for the latter.

Change-Id: Ia442ef70492bedd95d6c92cfcfb1786ab9d4573d
2020-04-02 01:32:57 +00:00
Tim Starling
507501d6ee Stop using SCRIPT_NAME where possible, rely on statically configured routing
It has become apparent that $_SERVER['SCRIPT_NAME'] may contain the same
thing as REQUEST_URI, for example in WMF production. PATH_INFO is not
set, so there is no way to split the URL into SCRIPT_NAME and PATH_INFO
components apart from configuration.

* Revert the fix for T34486, which added a route for SCRIPT_NAME to the
  PathRouter for the benefit of img_auth.php. In T235357, the route thus
  added contained $1, breaking everything.
* Remove calls to WebRequest::getPathInfo() from everywhere other than
  index.php. Dynamic modification of $wgArticlePath in order to make
  PathRouter work was weird and broken anyway. All that is really needed
  is a suffix of REQUEST_URI, so I added a function which provides that.
* Add $wgImgAuthPath, for use as a last resort workaround for T34486.
* Avoid the use of $_SERVER['SCRIPT_NAME'] to detect the currently
  running script.
* Deprecated wfGetScriptUrl(), a fairly simple wrapper for SCRIPT_NAME.
  Apparently no callers in core or extensions.

Bug: T235357
Change-Id: If2b82759f3f4aecec79d6e2d88cd4330927fdeca
2020-04-01 12:33:38 -04:00
jenkins-bot
751fcb315e Merge "resourceloader: Export ResourceModules as extension attribute" 2020-03-30 23:26:29 +00:00
jenkins-bot
c564ae6722 Merge "resourceloader: Export ResourceModuleSkinStyles as extension attribute" 2020-03-30 23:24:31 +00:00
Timo Tijhof
a999da181e resourceloader: Export ResourceModules as extension attribute
Instead of exporting this as a global variable, export it as an extension
attribute.

The $wgResourceModules configuration variable will continue to be supported
for its main purpose of adding modules. However it may no longer be used to
access the complete registry. In actuality, it was already incomplete because
modules defined via 'ResourceLoaderRegisterModules' hooks were already absent.

The full copy is now owned only by the ResourceLoader class and publicly
available via isModuleRegistered() and getModuleNames().

This opens the door to making it a lazy-loaded attribute, which would help
reduce the size of the "main" APCu cache key for ExtensionRegistry.
This is not possible with global variables as those must be exported
unconditionally from Setup.php.

Bug: T32956
Bug: T247265
Change-Id: I13cf05af458131ce8439eee770d7a62bd9404288
2020-03-30 23:11:05 +00:00
Timo Tijhof
69e9b31fc5 resourceloader: Export ResourceModuleSkinStyles as extension attribute
Instead of exporting this as a global variable, export it as an extension
attribute.

The $wgResourceModuleSkinStyles configuration variable will continue
to be supported for its main purpose of setting skin styles. However
it may no longer be used to read these settings. The canonical copy
of this is now restricted to the ResourceLoader class and not (yet)
made publicly available (I found no use cases for it).

This opens the door to making it lazy-loaded attribute, which would help
reduce the size of the "main" APCu cache key for ExtensionRegistry.

This is not possible with global variables as those must be exported
unconditionally from Setup.php.

Bug: T32956
Bug: T247265
Change-Id: I4ecf558d9c630c91959786d2573c34e619223cef
2020-03-30 16:08:00 -07:00
jenkins-bot
bced1fc879 Merge "resourceloader: Add more $wgResourceModules documentation" 2020-03-29 16:44:26 +00:00
jenkins-bot
fa5c5b1ad9 Merge "Remove skipcaptcha from the basic grant" 2020-03-27 12:00:49 +00:00
Holger Knust
50b62c49bf resourceloader: Add more $wgResourceModules documentation
Added documentation markup for $wgResourceModules in DefaultSettings.php
and added a reference to it in ResourceLoaderFileModule.php.

Bug:  T232566
Change-Id: Ib4c0bd55cc2a06f48ef36ceb069906f1d3a22826
2020-03-26 21:41:09 +00:00
jenkins-bot
4b27002f0b Merge "skin: Add $wgFooterLinkCacheExpiry and improve footer link preloading" 2020-03-26 20:23:39 +00:00
Aaron Schulz
c6b700be8d skin: Add $wgFooterLinkCacheExpiry and improve footer link preloading
Change-Id: Ibb44867e690ef5eb6ee4187ecdebb92ebbd009a3
2020-03-26 20:08:53 +00:00
jenkins-bot
4bd153c1bc Merge "DefaultSettings: Improve docs for $wgPasswordDefault" 2020-03-26 11:35:24 +00:00
jenkins-bot
bddb01d35a Merge "Purge expired watchlist items" 2020-03-26 00:38:56 +00:00
Timo Tijhof
9498132667 DefaultSettings: Improve docs for $wgPasswordDefault
Change-Id: I4322be2bba30c49304f9f3002c6d61a1b3f13f6d
2020-03-26 00:02:16 +00:00
Sam Wilson
83804ade46 Purge expired watchlist items
Add two methods to remove expired watchlist items:
1. A job that's triggered on about 10% of page edits; and
2. A new maintenance script.

Bug: T244804
Change-Id: Ica8ab92837c38fa4d484726c94d5181c08387e28
2020-03-26 07:54:20 +08:00
daniel
495323c063 Remove compat code for pre-MCR schema.
NOTE: This was manually tested to ensure it does not
break updates, see T242764.

Bug: T198557
Change-Id: I1d9f5465018bae10124514bc38169e23e0e613e6
2020-03-24 19:45:47 +01:00
jenkins-bot
b0e450e956 Merge "Add config variable $wgRestAPIAdditionalRouteFiles" 2020-03-23 16:11:05 +00:00
Bill Pirkle
6b772fee0b Add config variable $wgRestAPIAdditionalRouteFiles
New configuration variable $wgRestAPIAdditionalRouteFiles
allows specifying additional Core REST API route files to
include. The initial use is to include development routes
from new file coreDevelopmentRoutes.json only on testing
wikis, but not on production wikis.

Bug: T247997
Change-Id: Iff8a9b7f4cafb29162e9b10f3d32e2a85f6f58df
2020-03-23 10:22:58 -05:00
Brian Wolff
75f46ffd8f Allow filtering newusers log on Special:Log page
Newusers log can be really spammy on some wikis. This adds it
as a filter option (Like patrol, thanks and tag logs). However
it keeps the default to be show new user logs, so the default
behaviour stays the same.

Change-Id: I54b3bfe1afc2c1e500f4630e676465cec3ad8ce3
2020-03-23 07:37:44 +00:00
JJMC89
a9a13a3174 Remove skipcaptcha from the basic grant
skipcaptcha is a part of ConfirmEdit, not core.

Bug: T241118
Change-Id: Ifa9de57a25147e2e0672e7f3b97c9c779b21ca16
Depends-On: I6c17fff97d868090cf9f770d2dd66c089154eae2
2020-03-21 20:54:54 +00:00
jenkins-bot
63d850f225 Merge "Remove $wgProfileLimit setting" 2020-03-19 23:17:37 +00:00
jenkins-bot
0b60574d24 Merge "profiler: Improve $wgProfiler docs in DefaultSettings.php" 2020-03-19 23:17:01 +00:00
Timo Tijhof
c75a4ac16f Remove $wgProfileLimit setting
Deprecated since MediaWiki 1.25.

Bug: T247777
Bug: T228895
Change-Id: I638d9a219df7b5c661548354fd3d219ada340a86
2020-03-19 23:03:20 +00:00
Timo Tijhof
ac26a3575d profiler: Improve $wgProfiler docs in DefaultSettings.php
In particular, document the 'threshold' option.

Bug: T247777
Change-Id: I36eeb13ac3beb4a67c841e0a6fc262f89cda7242
2020-03-19 23:00:01 +00:00
Thiemo Kreuz
7a4df9b019 Remove auto-generated and empty lines in comments
… and add the missing newline after the initial <?php.

Change-Id: I83bbbb1504e4b2bd97eec63c7626d34c655c3197
2020-03-17 09:55:24 +01:00
Timo Tijhof
75ccdc6147 languages: Move default $wgNamespaceAliases to MessagesEn.php
These are not configuration but business logic, similar to the
canonical names that are in NamespaceInfo.php, these must always
exist and cannot be altered or unset.

They were previously unconditionally assigned during all requests
in Setup.php and passed down as "site configuration".

Changes:

* Move them to MessagesEn.php where they can be cached and
  processed the same way as other core-provided aliases.

  Document and confirm with tests that this is a mergeable
  attribute that follows the language chain.

* Remove the duplicated code in a few places that was reading
  this variable + Language::getNamespaceAliases(), to instead
  just call the latter and move the logic there, centralised,
  and tested.

  In doing so I noticed that these were applied in an
  inconsistent order. Sometimes the config won, sometimes not.
  There's no obvious right or wrong way here, but I've chosen
  to standardise on the way that Language::getNamespaceIds() did
  it, which is that config wins. This because that method seems
  to be most widely used of the three (it decides how URLs and
  titles are parsed), and thus the one I least want to change
  the behaviour of.

* Document that $wgNamespaceAliases may only be used to
  define (extra) aliases, it is and never was a way to access
  the complete list of aliases.

Bug: T189966
Change-Id: Ibb14181aba8c1b509264ed40523e9ab4000fd71a
2020-03-14 19:27:40 +00:00
Timo Tijhof
50c3a47140 Setup: Move wgSkipSkins appendix to Skin::getAllowedSkins
This isn't a default setting or fallback, it's unconditional
business logic that can't be overidden. This doesn't need to
run on every web request in Setup.php.

Bug: T189966
Change-Id: I708131b111cd2ff0e34c3cc8a4b933eff260b3da
2020-03-13 23:45:12 +00:00
Reedy
c030dacfbe Kill off $wgLocalInterwiki
Change-Id: I07e44d1384138704eea979263e45a9853a0ae621
2020-03-07 21:44:46 +00:00
jenkins-bot
b7a16d85da Merge "Remove $wgEnablePartialBlocks config and always enable partial blocks" 2020-03-05 21:41:08 +00:00
Timo Tijhof
a7dc3fcf63 objectcache: Deprecate 'apc', 'apcu', 'wincache' cache IDs
If something requires direct access it, there is an easier way
to do so.

If something prefers a re-used singleton, there are easier
ways for that as well.

Change-Id: Idb00650eacb31d58d4109b9a0f033a2123015dda
2020-03-04 23:23:06 +00:00
jenkins-bot
6512ef160c Merge "Introduce an expiry to WatchedItem" 2020-03-04 18:33:07 +00:00
MusikAnimal
bb56abfba0 Introduce an expiry to WatchedItem
Includes the new $wgWatchlistExpiry feature flag.

Consumers of WatchedItem and WatchedItemStore have not been changed to
make use of expiries, this along with associated UI changes will be done
in a separate patch.

Bug: T245213
Change-Id: Ifff5e56e0222bb325cf796e0aa3d88825820d1fd
2020-03-04 11:32:19 -05:00
Thalia
3db547e99b Remove $wgEnablePartialBlocks config and always enable partial blocks
Bug: T242912
Change-Id: Icf737140dd112dc4d222274ae40e225cb7a9d3fc
2020-03-04 13:45:44 +00:00
jenkins-bot
53c4d327d0 Merge "debug: Remove $wgDebugTimestamps feature" 2020-02-28 04:46:40 +00:00
DannyS712
8500f9de90 Remove $wgAllowTitlesInSVG, deprecated and unused
Bug: T246193
Change-Id: I7c54d2804344112cf588a072e4140dea8bf9e9ed
2020-02-26 05:31:07 +00:00