The purpose of MW_USE_LEGACY_DEFAULT_SETTINGS was to allow Setup.php to
load default values from DefaultSettings.php, instead of using
MainConfigSchema. It was put into place for the benefit of third-party
installations that encounter issues with using MainConfigSchema. No such
issues have been reported, so we can remove the compatibility switch in
1.40.
The use of DefaultSettings.php as been deprecated since 1.39, but there
are still several extensions that rely on loading it. It remains a stub
for MainConfigSchema::listDefaultValues() for now.
Change-Id: I280f80e5be15fbcd809596087b299add5f83af1f
DefaultSettings.php has been replaced by MainConfigSchema.
Loading DefaultSettings.php is deprecated.
Code that needs to have access to configuration defaults should use the
ConfigSchema service object.
Bug: T300129
Change-Id: I7b2c0ca95a78990be1cdb9dd9ace92f6dcf1af15
This reverts commit e08ea8ccb9.
Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).
Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
$wgSquidPurgeUseHostHeader is @since 1.21 and @deprecated since 1.33.
Follow-Up: I9776d11d4e2d184af35b1117cd7950354c0e343e
Change-Id: Ibaa261fcce3498eba56ab37c8ed95f52e59cfef4
While detecting the site name based on the request domain is common,
the exact mappings used in practice differ a lot. If we implemented one,
we could never change it. It seems beter to require the requested site
to be identified explicitly.
Bug: T221535
Change-Id: I31c20e87bb7d5fc4565714e86f547b42bacea82f
Remove the special case GIFAR vulnerability check from UploadBase. I
put it there because the GIFAR vulnerability was so severe that we
needed to check for it even if $wgVerifyMimeType was false. Now that
support for Java applets has been dropped from browsers, the
vulnerability is not so severe and we can wind back the paranoia.
Add a ZipDirectoryReader invocation to MimeAnalyzer, to replace some
terrible regex hacks. This allows MimeAnalyzer to detect docx files
saved by LibreOffice (T291750).
This is also the new place for the GIFAR check. Add application/java
to $wgMimeTypeExclusions so that JAR uploads are rejected.
Since ZipDirectoryReader cannot look inside the contents of files in the
package, it can't detect the subtype of Open Document files. Use the
file extension instead, like what we do for Microsoft OPC files.
Remove public method detectZipType -- no callers in code search.
Bug: T291750
Change-Id: Iff1611c7adda9c0f0ed31593bad6dfffc9c9a086
Declare deprecations as part of the schema, not just in the doc string.
This allows deprecations to carry over to MainConfigNames and
DefaultSettings.php.
Change-Id: I9776d11d4e2d184af35b1117cd7950354c0e343e
Add services and utilities for automatic creation of temporary user
accounts on page save, in order to avoid exposing the user's IP
address.
* Add $wgAutoCreateTempUser, for configuring the system
* Add TempUserConfig service, which interprets the config.
* Add TempUserCreator service, which creates users during page save as
requested by EditPage. With proxy methods to TempUserConfig for
convenience.
* Add table user_autocreate_serial. Table creation is necessary before
the feature is enabled but is not necessary before deployment of this
commit.
Bug: T300263
Change-Id: Ib14a352490fc42039106523118e8d021844e3dfb
MWGrants is deprecated and should be replaced with the GrantsInfo and
the GrantsLocalization services.
Bug: T253077
Change-Id: I3cbf568b6de654acb6b06b4ab5d9d97a09f78ece
This allows for PHPDoc-style types to be used in MainConfigSchema,
and adds aliases for the 'object' and 'array' types, to avoid confusion.
The type 'map' can now be used for associative arrays, it will be
represented as 'object' in JSON Schema. Similarly, 'list' can be used to
refer to sequential arrays, it will be represented as 'array' in JSON schema.
In addition, the basic PHP types are mapped to their JSON counterparts,
including support for nullable types. For example:
"?map" will become [ "object", "null" ];
"float|false" will become [ "number", "boolean" ];
Change-Id: I89617d06afd1e97ee1bc9bc49b6c77bed7bd50d9
Added support for an easy to configure multi-tenant ("wiki farm") mode:
Settings for each site can be placed in a directory specified by
$wgWikiFarmSettingsDirectory. Site detection is controlled by
$wgWikiFarmSiteDetector and defaults to the requested host name.
Instructions for manual testing: https://etherpad.wikimedia.org/p/T221535
Bug: T221535
Change-Id: I7581921b7d99ba1fe7e25523fde691d76b67a99c
* This is the first step of migrating Parsoid integration code into
core and transitioning Parsoid from an extension to a pure library.
* Parsoid already has conditional code to skip loading Parsoid's
copy of its classes, but it relies on the existence of ParsoidServices.
Technically ParsoidServices isn't needed once Parsoid is migrated to
core -- users can just use MediaWikiServices instead -- but we need
to temporarily add ParsoidServices as a marker class during the
transition.
This version of Parsoid's ServiceWiring comes from Parsoid commit
898c813fd832b3f2d7b5a37f60bd65e8368ce18f.
Bug: T302118
Change-Id: I0b388d93143a782c2c3b72e46407572e5c586e4a
This patch introduces a new system message,
MediaWiki:copyupload-allowed-domains, which lets sysops to define which
domains can be used with the upload-by-url tool. This feature is behind
an off-by-default feature flag, which lets system administrators
disable this feature if it is not wanted.
Bug: T300407
Change-Id: Iae7dafbd71182695444210409d550e5b6d10928b
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
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
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
$wgStyleSheetPath has been a deprecated alias for $wgStylePath since 1.3 (2004).
Time to get rid of it.
Change-Id: I78a6394003b9aefab7aa8559b8e2b22bc50154fc
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
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
* 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
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
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
$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