extensionSubstitution returns a string, not null,
so if $params['attr'] is not set, default to using
an empty string (''), not null.
Bug: T312519
Bug: T312520
Change-Id: I566d95a32cffe1ef20f18ae9d9af96d57e0823a9
They have been deprecated since 1.27.
Depends-On: I82abb695f30a8c3869dfa620483a9168dbf49fa1
Depends-On: I3da32e6620f2213b50e0e366884c47188208acc1
Change-Id: I49d95873b18261954b0c50ff551f4b1ea9a5fbdf
Avoid having to look at and query multiple channels for the same
core component. Use different log levels and messages instead.
E.g. avoid Foo and FooError or FooBar, use only "Foo".
This also switched to the injected Logger object at the same time.
This also avoids global wfDebugLog() at the same time.
Bug: T32956
Change-Id: I3e43b10d26858c5b3851476c8bbd27282316dd32
Some variables are set before early returns but used after - move that
Some variables are set before an if, but only used inside the if - move
the variables inside the if to skip the init of the variable
Change-Id: I1da72bc7fae44316162ab96672fd6745e65341fc
The PHP `isset(...)` construct covers a multitude of possible "wrong
types" for the left hand side of an array access, but it still crashes
(with "Cannot use object of type stdClass as array") if the left hand
side is an object.
Bug: T312242
Change-Id: I35026c573fb941004764d46d5652ebcddc559c03
MessageCacheReplaceHook claims that the $title parameter will be a
Title instance, but refreshAndReplaceInternal() passes a string.
Update the hook documentation to match the actual behavior.
Change-Id: Ia4ab8a21c40fc7d3b4a15ab3bdef3065601fea5c
And similar methods such as selectRowCount.
Until I340ad4144c31 is unblocked.
Bug: T243051
Bug: T311866
Bug: T259518
Change-Id: Ic0e757a8e23aba16d8e273e4326276f659603c9e
This sets MainCacheType to 'hash', so the main cache is functional
within test cases. Between tests we are already calling ObjectCache::clear,
so the cache will not leak data into other test cases.
It turned out that the way we have been overriding configuration
settings in MediaWikiIntegrationTestCase is insufficient, since the
overrides would only apply in the main Config object, not in global
variables. This means they could not be overwritten with setMwGlobals.
So this patch also changes how we apply config overrides for test setup.
Config overrides that happen during tests work as before.
Depends-On: Ic36e92b73f22fd64e2d0b680d8e900f598158460
Change-Id: Ia60cb0bc18b235f23d9778da8241f65accfc0d35
The main object cache is disabled during testing. Some integration tests
need it though. This provides a clean way to enable it, to replace the hacks
that were used so far.
Note that we may want to enable the main cache during testing soon. When
that happens, this method is still useful to disable the cache in certain
tests, and to set a specific cache instance.
Change-Id: I04ae1bf1b6b2c8f6310acd2edf89459d01a9c870
This implements config overrides with a HashConfig that is layered on
top of the base config, so we can move away from global variables.
Global variables are still updated using setMwGlobals, for compatibility
with code that is still reading configuration from global variables.
This fixes an issue with the default overrides not being applied to
global variables.
Change-Id: I1922d9b903dcafb83691c2d96790f72747eeef9c
The goal is to keep the actual default values for settings in the same
place as the setting is declared, and applied using the regular means
for loading the settings -- not in a separate piece of code that needs
to be loaded through some entirely different mechanism.
SetupDynamicConfig.php now contains a few categories of things:
* Post-processing of configuration settings, where already-set settings
are altered. This could be moved to MainConfigSchema too as a separate
set of methods.
* Processing of old aliases of settings (blacklist, slave) that are not
registered as settings anymore and therefore are not available to
MainConfigSchema. This could perhaps be moved to LocalSettings
processing somehow?
* Setting $wgUseEnotif, which is also not registered as a setting.
Easiest would be just to declare it as a setting and have it set
unconditionally.
* Setting the actual timezone to $wgLocaltimezone. This is not related
to configuration and should just be in Setup.php.
Bug: T305093
Change-Id: Ia5c23b52dbbfcb3d07ffcf5d3b7f2d7befba2a26
We don't show the time for timestamps that are more than 5 days old
elsewhere in this function, so we shouldn't start showing them again
for timestamps in another year.
Keep the full timestamp format for timestamps in the future, with the
TODO to improve it.
Improve comments throughout the function to be more accurate.
Bug: T133468
Change-Id: I68c6105cc83ca12e0a8f41e8b611bf4b8f35cd87
Use a single callback for both mocks. This is needed because using
PHP 8.1 results in:
> 1) LBFactoryTest::testChronologyProtector
> Implicit conversion from float 1657063075.187724
> to int loses precision
>
> tests/phpunit/includes/db/LBFactoryTest.php:313
> includes/libs/rdbms/ChronologyProtector.php:290
Bug: T312183
Change-Id: I2764cf9b81b08832c904bf7245bd54ca0f0eddad
Note that null triggers the following for php 8.1:
PHP Deprecated: strrev(): Passing null to parameter #1 ($string) of
type string is deprecated
Got a few of these in WikiMapTest::testMakeForeignLink(), caused by a
single call in DBSiteStore.
Bug: T289926
Change-Id: I0b29963ec0e2e8a38a66e250e81fbc16e42465ab