Read revision ID
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 24 Apr 2006 08:47:59 +0000 (08:47 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 24 Apr 2006 08:47:59 +0000 (08:47 +0000)
includes/SpecialImport.php

index e349bd5..91abcea 100644 (file)
@@ -122,6 +122,7 @@ function wfSpecialImport( $page = '' ) {
  */
 class WikiRevision {
        var $title = NULL;
+       var $id = 0;
        var $timestamp = "20010115000000";
        var $user = 0;
        var $user_text = "";
@@ -133,6 +134,10 @@ class WikiRevision {
                $this->title = Title::newFromText( $text );
        }
 
+       function setID( $id ) {
+               $this->id = $id;
+       }
+
        function setTimestamp( $ts ) {
                # 2003-08-05T18:30:02Z
                $this->timestamp = wfTimestamp( TS_MW, $ts );
@@ -162,6 +167,10 @@ class WikiRevision {
                return $this->title;
        }
 
+       function getID() { 
+               return $this->id;
+       }
+
        function getTimestamp() {
                return $this->timestamp;
        }
@@ -468,6 +477,11 @@ class WikiImporter {
                        $this->workTitle = $this->appenddata;
                        $this->pageCallback( $this->workTitle );
                        break;
+               case "id":
+                       if ( $this->parenttag == 'revision' ) {
+                               $this->workRevision->setID( $this->appenddata );
+                       }
+                       break;
                case "text":
                        $this->workRevision->setText( $this->appenddata );
                        break;