Change @since and @deprecated notes to 1.22
[lhc/web/wiklou.git] / includes / Export.php
index 9400c41..98de4c0 100644 (file)
@@ -599,7 +599,7 @@ class XmlDumpWriter {
                $out = "  <page>\n";
                $title = Title::makeTitle( $row->page_namespace, $row->page_title );
                $out .= '    ' . Xml::elementClean( 'title', array(), self::canonicalTitle( $title ) ) . "\n";
-               $out .= '    ' . Xml::element( 'ns', array(), strval( $row->page_namespace) ) . "\n";
+               $out .= '    ' . Xml::element( 'ns', array(), strval( $row->page_namespace ) ) . "\n";
                $out .= '    ' . Xml::element( 'id', array(), strval( $row->page_id ) ) . "\n";
                if ( $row->page_is_redirect ) {
                        $page = WikiPage::factory( $title );
@@ -689,7 +689,7 @@ class XmlDumpWriter {
                        $content_model = strval( $row->rev_content_model );
                } else {
                        // probably using $wgContentHandlerUseDB = false;
-                       // @todo: test!
+                       // @todo test!
                        $title = Title::makeTitle( $row->page_namespace, $row->page_title );
                        $content_model = ContentHandler::getDefaultModelFor( $title );
                }
@@ -700,7 +700,7 @@ class XmlDumpWriter {
                        $content_format = strval( $row->rev_content_format );
                } else {
                        // probably using $wgContentHandlerUseDB = false;
-                       // @todo: test!
+                       // @todo test!
                        $content_handler = ContentHandler::getForModelID( $content_model );
                        $content_format = $content_handler->getDefaultFormat();
                }
@@ -824,10 +824,13 @@ class XmlDumpWriter {
                        $archiveName = '';
                }
                if ( $dumpContents ) {
+                       $be = $file->getRepo()->getBackend();
                        # Dump file as base64
                        # Uses only XML-safe characters, so does not need escaping
+                       # @TODO: too bad this loads the contents into memory (script might swap)
                        $contents = '      <contents encoding="base64">' .
-                               chunk_split( base64_encode( file_get_contents( $file->getPath() ) ) ) .
+                               chunk_split( base64_encode(
+                                       $be->getFileContents( array( 'src' => $file->getPath() ) ) ) ) .
                                "      </contents>\n";
                } else {
                        $contents = '';
@@ -1191,7 +1194,7 @@ class Dump7ZipOutput extends DumpPipeOutput {
                // Suppress annoying useless crap from p7zip
                // Unfortunately this could suppress real error messages too
                $command .= ' >' . wfGetNull() . ' 2>&1';
-               return( $command );
+               return $command;
        }
 
        /**