summaryrefslogtreecommitdiff
path: root/maintenance/renderDump.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/renderDump.php')
-rw-r--r--maintenance/renderDump.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/maintenance/renderDump.php b/maintenance/renderDump.php
index 24bedfa4..0cde28c5 100644
--- a/maintenance/renderDump.php
+++ b/maintenance/renderDump.php
@@ -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
@@ -69,9 +69,10 @@ class DumpRenderer extends Maintenance {
$importer->doImport();
$delta = microtime( true ) - $this->startTime;
- $this->error( "Rendered {$this->count} pages in " . round($delta, 2) . " seconds " );
- if ($delta > 0)
- $this->error( round($this->count / $delta, 2) . " pages/sec" );
+ $this->error( "Rendered {$this->count} pages in " . round( $delta, 2 ) . " seconds " );
+ if ( $delta > 0 ) {
+ $this->error( round( $this->count / $delta, 2 ) . " pages/sec" );
+ }
$this->error( "\n" );
}
@@ -80,8 +81,6 @@ class DumpRenderer extends Maintenance {
* @param $rev Revision
*/
public function handleRevision( $rev ) {
- global $wgParserConf;
-
$title = $rev->getTitle();
if ( !$title ) {
$this->error( "Got bogus revision with null title!" );
@@ -100,17 +99,16 @@ class DumpRenderer extends Maintenance {
$this->output( sprintf( "%s\n", $filename, $display ) );
$user = new User();
- $parser = new $wgParserConf['class']();
$options = ParserOptions::newFromUser( $user );
- $output = $parser->parse( $rev->getText(), $title, $options );
+ $content = $rev->getContent();
+ $output = $content->getParserOutput( $title, null, $options );
file_put_contents( $filename,
- "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " .
- "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" .
- "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" .
+ "<!DOCTYPE html>\n" .
+ "<html lang=\"en\" dir=\"ltr\">\n" .
"<head>\n" .
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" .
+ "<meta charset=\"UTF-8\" />\n" .
"<title>" . htmlspecialchars( $display ) . "</title>\n" .
"</head>\n" .
"<body>\n" .
@@ -121,4 +119,4 @@ class DumpRenderer extends Maintenance {
}
$maintClass = "DumpRenderer";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;