X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrenderDump.php;h=2218a5e7a3e247ed6836e67ad69dae0b807c67a3;hb=f2c242e2e8d86d6d12ae9c160b88c43558306d8f;hp=2039a21603e860606fe134c852b63e11bdd55293;hpb=e593d18a886a9a9286753b41e4941fcb456a616a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/renderDump.php b/maintenance/renderDump.php index 2039a21603..2218a5e7a3 100644 --- a/maintenance/renderDump.php +++ b/maintenance/renderDump.php @@ -7,7 +7,7 @@ * Templates etc are pulled from the local wiki database, not from the dump. * * Copyright (C) 2006 Brion Vibber - * http://www.mediawiki.org/ + * 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 @@ -28,7 +28,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that takes page text out of an XML dump file @@ -61,7 +61,7 @@ class DumpRenderer extends Maintenance { } $source = new ImportStreamSource( $this->getStdin() ); - $importer = new WikiImporter( $source ); + $importer = new WikiImporter( $source, $this->getConfig() ); $importer->setRevisionCallback( array( &$this, 'handleRevision' ) ); @@ -78,12 +78,13 @@ class DumpRenderer extends Maintenance { /** * Callback function for each revision, turn into HTML and save - * @param $rev Revision + * @param Revision $rev */ public function handleRevision( $rev ) { $title = $rev->getTitle(); if ( !$title ) { $this->error( "Got bogus revision with null title!" ); + return; } $display = $title->getPrefixedText(); @@ -105,11 +106,10 @@ class DumpRenderer extends Maintenance { $output = $content->getParserOutput( $title, null, $options ); file_put_contents( $filename, - "\n" . - "\n" . + "\n" . + "\n" . "\n" . - "\n" . + "\n" . "" . htmlspecialchars( $display ) . "\n" . "\n" . "\n" . @@ -120,4 +120,4 @@ class DumpRenderer extends Maintenance { } $maintClass = "DumpRenderer"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;