Fix autoloading of ExportProgressFilter
authorAlbert221 <w.albert221@gmail.com>
Wed, 13 Dec 2017 16:59:45 +0000 (17:59 +0100)
committerAlbert221 <w.albert221@gmail.com>
Wed, 13 Dec 2017 21:04:59 +0000 (22:04 +0100)
Bug: T177239
Change-Id: Ieb5d5aa78d569af8cd8f8bfa32ce10a33482cb84

autoload.php
includes/export/ExportProgressFilter.php [new file with mode: 0644]
maintenance/backup.inc

index cd01828..3869067 100644 (file)
@@ -449,7 +449,7 @@ $wgAutoloadLocalClasses = [
        'Exif' => __DIR__ . '/includes/media/Exif.php',
        'ExifBitmapHandler' => __DIR__ . '/includes/media/ExifBitmap.php',
        'ExplodeIterator' => __DIR__ . '/includes/libs/ExplodeIterator.php',
-       'ExportProgressFilter' => __DIR__ . '/maintenance/backup.inc',
+       'ExportProgressFilter' => __DIR__ . '/includes/export/ExportProgressFilter.php',
        'ExportSites' => __DIR__ . '/maintenance/exportSites.php',
        'ExtensionJsonValidationError' => __DIR__ . '/includes/registration/ExtensionJsonValidationError.php',
        'ExtensionJsonValidator' => __DIR__ . '/includes/registration/ExtensionJsonValidator.php',
diff --git a/includes/export/ExportProgressFilter.php b/includes/export/ExportProgressFilter.php
new file mode 100644 (file)
index 0000000..9b1571f
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Copyright © 2005 Brion Vibber <brion@pobox.com>
+ * https://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * @ingroup Dump
+ */
+class ExportProgressFilter extends DumpFilter {
+       /**
+        * @var BackupDumper
+        */
+       private $progress;
+
+       function __construct( &$sink, &$progress ) {
+               parent::__construct( $sink );
+               $this->progress = $progress;
+       }
+
+       function writeClosePage( $string ) {
+               parent::writeClosePage( $string );
+               $this->progress->reportPage();
+       }
+
+       function writeRevision( $rev, $string ) {
+               parent::writeRevision( $rev, $string );
+               $this->progress->revCount();
+       }
+}
index 341a299..00dbd00 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 require_once __DIR__ . '/Maintenance.php';
-require_once __DIR__ . '/../includes/export/DumpFilter.php';
 
 use Wikimedia\Rdbms\LoadBalancer;
 use Wikimedia\Rdbms\IDatabase;
@@ -420,20 +419,3 @@ class BackupDumper extends Maintenance {
                }
        }
 }
-
-class ExportProgressFilter extends DumpFilter {
-       function __construct( &$sink, &$progress ) {
-               parent::__construct( $sink );
-               $this->progress = $progress;
-       }
-
-       function writeClosePage( $string ) {
-               parent::writeClosePage( $string );
-               $this->progress->reportPage();
-       }
-
-       function writeRevision( $rev, $string ) {
-               parent::writeRevision( $rev, $string );
-               $this->progress->revCount();
-       }
-}