Merge "Fix creation of pages in the MediaWiki namespace."
[lhc/web/wiklou.git] / maintenance / backupTextPass.inc
index ec395eb..81e61b7 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/backup.inc' );
+require_once( __DIR__ . '/backup.inc' );
 
 /**
  * @ingroup Maintenance
@@ -169,7 +169,7 @@ class TextPassDumper extends BackupDumper {
                $this->xmlwriterobj = new XmlDumpWriter();
 
                $input = fopen( $this->input, "rt" );
-               $result = $this->readDump( $input );
+               $this->readDump( $input );
 
                if ( $this->spawnProc ) {
                        $this->closeSpawn();
@@ -247,9 +247,9 @@ class TextPassDumper extends BackupDumper {
 
                if ( $this->reporting ) {
                        $now = wfTimestamp( TS_DB );
-                       $nowts = wfTime();
-                       $deltaAll = wfTime() - $this->startTime;
-                       $deltaPart = wfTime() - $this->lastTime;
+                       $nowts = microtime( true );
+                       $deltaAll = $nowts - $this->startTime;
+                       $deltaPart = $nowts - $this->lastTime;
                        $this->pageCountPart = $this->pageCount - $this->pageCountLast;
                        $this->revCountPart = $this->revCount - $this->revCountLast;
 
@@ -354,12 +354,12 @@ class TextPassDumper extends BackupDumper {
                                wfDebug( "TextDumpPass::readDump encountered XML parsing error\n" );
 
                                $byte = xml_get_current_byte_index( $parser );
-                               $msg = wfMsgHtml( 'xml-error-string',
+                               $msg = wfMessage( 'xml-error-string',
                                        'XML import parse failure',
                                        xml_get_current_line_number( $parser ),
                                        xml_get_current_column_number( $parser ),
                                        $byte . ( is_null( $chunk ) ? null : ( '; "' . substr( $chunk, $byte -$offset, 16 ) . '"' ) ),
-                                       xml_error_string( xml_get_error_code( $parser ) ) );
+                                       xml_error_string( xml_get_error_code( $parser ) ) )->escaped();
 
                                xml_parser_free( $parser );