aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RELEASE-NOTES-1.424
-rw-r--r--maintenance/dumpIterator.php2
-rw-r--r--maintenance/fetchText.php2
-rw-r--r--maintenance/includes/BackupDumper.php2
-rw-r--r--maintenance/includes/Maintenance.php14
-rw-r--r--maintenance/includes/TextPassDumper.php2
-rw-r--r--maintenance/install.php6
-rw-r--r--maintenance/mergeMessageFileList.php2
-rw-r--r--maintenance/rebuildFileCache.php2
-rw-r--r--maintenance/rebuildLocalisationCache.php2
-rw-r--r--maintenance/runJobs.php2
-rw-r--r--tests/parser/editTests.php2
-rw-r--r--tests/parser/fuzzTest.php2
-rw-r--r--tests/parser/parserTests.php2
14 files changed, 19 insertions, 27 deletions
diff --git a/RELEASE-NOTES-1.42 b/RELEASE-NOTES-1.42
index 0aea14551e2d..6b953ca46b97 100644
--- a/RELEASE-NOTES-1.42
+++ b/RELEASE-NOTES-1.42
@@ -136,6 +136,10 @@ because of Phabricator reports.
and MediaWikiPerformActionHook::onMediaWikiPerformAction changed from
MediaWiki to ActionEntryPoint. Relevant methods are still available on
the object.
+* Classes that override Maintenance::finalSetup() must now declare the
+ $settings parameter and pass it on when calling the parent implementation.
+ MaintenanceRunner will always provide this parameter when calling
+ finalSetup().
* MediaWiki's virtualrest internal library has been removed in favor of the
HTTP library like: Guzzle, MultiHttpClient or MwHttpRequest.
* Several deprecated methods have been removed from the Content interface,
diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php
index 0ac40225839e..6f77eb26af72 100644
--- a/maintenance/dumpIterator.php
+++ b/maintenance/dumpIterator.php
@@ -116,7 +116,7 @@ abstract class DumpIterator extends Maintenance {
$this->error( "Memory peak usage of " . memory_get_peak_usage() . " bytes\n" );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
parent::finalSetup( $settingsBuilder );
if ( $this->getDbType() == Maintenance::DB_NONE ) {
diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php
index 354ff89cb683..f94c40949e70 100644
--- a/maintenance/fetchText.php
+++ b/maintenance/fetchText.php
@@ -46,7 +46,7 @@ class FetchText extends Maintenance {
);
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
// This script should always try to run all db queries in the 'dump' group if such
// a group exists, just like the BackupDumper and TextPassDumper modules.
// To account for parts of MediaWiki that get their own db connection outside of
diff --git a/maintenance/includes/BackupDumper.php b/maintenance/includes/BackupDumper.php
index 9e783804bb06..b933db018253 100644
--- a/maintenance/includes/BackupDumper.php
+++ b/maintenance/includes/BackupDumper.php
@@ -176,7 +176,7 @@ abstract class BackupDumper extends Maintenance {
}
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
parent::finalSetup( $settingsBuilder );
// re-declare the --schema-version option to include the default schema version
// in the description.
diff --git a/maintenance/includes/Maintenance.php b/maintenance/includes/Maintenance.php
index 16f77622accc..db11db200cc8 100644
--- a/maintenance/includes/Maintenance.php
+++ b/maintenance/includes/Maintenance.php
@@ -875,17 +875,9 @@ abstract class Maintenance {
*
* @stable to override
*
- * @param SettingsBuilder|null $settingsBuilder
- */
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
- if ( !$settingsBuilder ) {
- // HACK for backwards compatibility. All subclasses that override
- // finalSetup() should be updated to pass $settingsBuilder along.
- // XXX: We don't want the parameter to be nullable! How can we make it required
- // without breaking backwards compatibility?
- $settingsBuilder = $GLOBALS['wgSettings'];
- }
-
+ * @param SettingsBuilder $settingsBuilder
+ */
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
$config = $settingsBuilder->getConfig();
$overrides = [];
$overrides['DBadminuser'] = $config->get( MainConfigNames::DBadminuser );
diff --git a/maintenance/includes/TextPassDumper.php b/maintenance/includes/TextPassDumper.php
index ea684bbdc3e3..4a51968d33c0 100644
--- a/maintenance/includes/TextPassDumper.php
+++ b/maintenance/includes/TextPassDumper.php
@@ -168,7 +168,7 @@ TEXT
}
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
parent::finalSetup( $settingsBuilder );
SevenZipStream::register();
diff --git a/maintenance/install.php b/maintenance/install.php
index 722c5720ac9b..7748bad5272d 100644
--- a/maintenance/install.php
+++ b/maintenance/install.php
@@ -106,11 +106,7 @@ class CommandLineInstaller extends Maintenance {
return true;
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
- if ( !$settingsBuilder ) {
- $settingsBuilder = SettingsBuilder::getInstance();
- }
-
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
parent::finalSetup( $settingsBuilder );
Installer::overrideConfig( $settingsBuilder );
}
diff --git a/maintenance/mergeMessageFileList.php b/maintenance/mergeMessageFileList.php
index 28fae90d62a4..6e1c29c05e46 100644
--- a/maintenance/mergeMessageFileList.php
+++ b/maintenance/mergeMessageFileList.php
@@ -114,7 +114,7 @@ class MergeMessageFileList extends Maintenance {
$this->generateMessageFileList( $setupFiles );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
# This script commonly needs to be run before the l10n cache. But if
# LanguageCode is not 'en', it won't be able to run because there is
# no l10n cache. Break the cycle by forcing the LanguageCode setting to 'en'.
diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php
index 4c08ca9b74ab..6b66004cfd1e 100644
--- a/maintenance/rebuildFileCache.php
+++ b/maintenance/rebuildFileCache.php
@@ -47,7 +47,7 @@ class RebuildFileCache extends Maintenance {
$this->setBatchSize( 100 );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
$this->enabled = $settingsBuilder->getConfig()->get( MainConfigNames::UseFileCache );
// Script will handle capturing output and saving it itself
$settingsBuilder->putConfigValue( MainConfigNames::UseFileCache, false );
diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php
index eb8ed07cbe58..7bfac633dfbf 100644
--- a/maintenance/rebuildLocalisationCache.php
+++ b/maintenance/rebuildLocalisationCache.php
@@ -84,7 +84,7 @@ class RebuildLocalisationCache extends Maintenance {
);
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
# This script needs to be run to build the initial l10n cache. But if
# LanguageCode is not 'en', it won't be able to run because there is
# no l10n cache. Break the cycle by forcing the LanguageCode setting to 'en'.
diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php
index eec330681e4b..f1f27d4675d0 100644
--- a/maintenance/runJobs.php
+++ b/maintenance/runJobs.php
@@ -44,7 +44,7 @@ class RunJobs extends Maintenance {
$this->addOption( 'wait', 'Wait for new jobs instead of exiting', false, false );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
// So extensions (and other code) can check whether they're running in job mode.
// This is not defined if this script is included from installer/updater or phpunit.
define( 'MEDIAWIKI_JOB_RUNNER', true );
diff --git a/tests/parser/editTests.php b/tests/parser/editTests.php
index f2888508fbb3..0c6ddfe5c3cc 100644
--- a/tests/parser/editTests.php
+++ b/tests/parser/editTests.php
@@ -43,7 +43,7 @@ class ParserEditTests extends Maintenance {
$this->addOption( 'session-data', 'internal option, do not use', false, true );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
// Some methods which are discouraged for normal code throw exceptions unless
// we declare this is just a test.
define( 'MW_PARSER_TEST', true );
diff --git a/tests/parser/fuzzTest.php b/tests/parser/fuzzTest.php
index eb33db29b783..403d35bdfed2 100644
--- a/tests/parser/fuzzTest.php
+++ b/tests/parser/fuzzTest.php
@@ -30,7 +30,7 @@ class ParserFuzzTest extends Maintenance {
$this->addOption( 'seed', 'Start the fuzz test from the specified seed', false, true );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
// Make RequestContext::resetMain() happy
define( 'MW_PARSER_TEST', 1 );
diff --git a/tests/parser/parserTests.php b/tests/parser/parserTests.php
index 0be7a72d43ae..0bcbfffffef8 100644
--- a/tests/parser/parserTests.php
+++ b/tests/parser/parserTests.php
@@ -103,7 +103,7 @@ class ParserTestsMaintenance extends Maintenance {
'for finer grained editing of tests.' );
}
- public function finalSetup( SettingsBuilder $settingsBuilder = null ) {
+ public function finalSetup( SettingsBuilder $settingsBuilder ) {
// Some methods which are discouraged for normal code throw exceptions unless
// we declare this is just a test.
define( 'MW_PARSER_TEST', true );