Change WikiImporter to now requires the second parameter to be an instance of the...
authorMatthew Bowker <matthewrbowker@me.com>
Sun, 13 Aug 2017 22:54:26 +0000 (16:54 -0600)
committerFlorian Schmidt <florian.schmidt.stargatewissen@gmail.com>
Mon, 14 Aug 2017 16:18:53 +0000 (18:18 +0200)
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

RELEASE-NOTES-1.30
includes/import/WikiImporter.php

index 90d6cd9..9474f21 100644 (file)
@@ -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
index 7c89b23..2099709 100644 (file)
@@ -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() ) ) {