Add the new SHA1 revision field to the XML export, add SHA1 field to export-0.6.xsd...
authorDiederik van Liere <diederik@users.mediawiki.org>
Mon, 23 Jan 2012 19:48:20 +0000 (19:48 +0000)
committerDiederik van Liere <diederik@users.mediawiki.org>
Mon, 23 Jan 2012 19:48:20 +0000 (19:48 +0000)
docs/export-0.6.xsd
includes/Export.php

index a225e52..55428b5 100644 (file)
@@ -15,8 +15,8 @@
 
        Version 0.5 adds byte count per revision.
        
-       Version 0.6 adds a separate namespace tag, locates the
-       redirect target and strips of the namespace from the title
+       Version 0.6 adds a separate namespace tag, and resolves the
+       redirect target and adds a separate sha1 tag for each revision
        
        The canonical URL to the schema document is:
        http://www.mediawiki.org/xml/export-0.6.xsd
                        <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
                        <element name="title" type="string"/>
                        
-                       <!-- Namesapce in text form -->
-                       <element name="ns" type="string"/>
+                       <!-- Namespace in canonical form -->
+                       <element name="ns" type="positiveInteger"/>
                        
                        <!-- optional page ID number -->
                        <element name="id" type="positiveInteger" minOccurs="0"/>
                        <element name="contributor" type="mw:ContributorType"/>
                        <element name="minor" minOccurs="0" />
                        <element name="comment" type="mw:CommentType" minOccurs="0"/>
+                       <element name="sha1" type="string" />
                        <element name="text" type="mw:TextType" />
                </sequence>
        </complexType>
index 695a7f7..7773d03 100644 (file)
@@ -486,6 +486,13 @@ class XmlDumpWriter {
                                $out .= '    ' . Xml::element( 'redirect', array( 'title' => self::canonicalTitle( $redirect ) ) ) . "\n";
                        }
                }
+               
+               if ( $row->rev_sha1 ) {
+                       $out .= "      " . Xml::element('sha1', null, strval($row->rev_sha1) ) . "\n";
+               } else {
+                       $out .= "      <sha1/>\n";
+               }
+               
                if ( $row->page_restrictions != '' ) {
                        $out .= '    ' . Xml::element( 'restrictions', array(),
                                strval( $row->page_restrictions ) ) . "\n";