From: Matthew Bowker Date: Sun, 13 Aug 2017 22:54:26 +0000 (-0600) Subject: Change WikiImporter to now requires the second parameter to be an instance of the... X-Git-Tag: 1.31.0-rc.0~2393 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=af1434ff2feaf132e96e9a00acf0818944692a61 Change WikiImporter to now requires the second parameter to be an instance of the Config class. Prior to this change, the second parameter to WikiImporter was optional. If the parameter didn't exist, it would get filled in with a MediaWikiServices::getInstance()->getMainConfig(). It would also emit a hard deprecation warning. This behavior has existed since 1.25. Bug: T61113 Change-Id: Ic15cc103c7d2b7fb499f1632c0001b8a3dbdf778 --- diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30 index 90d6cd9bdc..9474f21fd2 100644 --- a/RELEASE-NOTES-1.30 +++ b/RELEASE-NOTES-1.30 @@ -165,6 +165,9 @@ changes to languages because of Phabricator reports. * mw.util.escapeId() was deprecated, use escapeIdForAttribute() or escapeIdForLink(). * MagicWord::replaceMultiple() (deprecated in 1.25) was removed. +* WikiImporter now requires the second parameter to be an instance of the Config, + class. Prior to that, the Config parameter was optional (a behavior deprecated in + 1.25). == Compatibility == MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 7c89b23a20..209970971e 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -55,16 +55,12 @@ class WikiImporter { * @param Config $config * @throws Exception */ - function __construct( ImportSource $source, Config $config = null ) { + function __construct( ImportSource $source, Config $config ) { if ( !class_exists( 'XMLReader' ) ) { throw new Exception( 'Import requires PHP to have been compiled with libxml support' ); } $this->reader = new XMLReader(); - if ( !$config ) { - wfDeprecated( __METHOD__ . ' without a Config instance', '1.25' ); - $config = MediaWikiServices::getInstance()->getMainConfig(); - } $this->config = $config; if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) {