From: Albert221 Date: Wed, 13 Dec 2017 16:59:45 +0000 (+0100) Subject: Fix autoloading of ExportProgressFilter X-Git-Tag: 1.31.0-rc.0~1209^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=6a47a03236c926ec9a01bf2df03ee7672c2cb6a9;p=lhc%2Fweb%2Fwiklou.git Fix autoloading of ExportProgressFilter Bug: T177239 Change-Id: Ieb5d5aa78d569af8cd8f8bfa32ce10a33482cb84 --- diff --git a/autoload.php b/autoload.php index cd01828a6c..38690676ac 100644 --- a/autoload.php +++ b/autoload.php @@ -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 index 0000000000..9b1571f7de --- /dev/null +++ b/includes/export/ExportProgressFilter.php @@ -0,0 +1,47 @@ + + * 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(); + } +} diff --git a/maintenance/backup.inc b/maintenance/backup.inc index 341a2992ff..00dbd00c86 100644 --- a/maintenance/backup.inc +++ b/maintenance/backup.inc @@ -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(); - } -}