Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / maintenance / storage / dumpRev.php
index 91a5f3b..7d9883e 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Revision\SlotRecord;
 
 require_once __DIR__ . '/../Maintenance.php';
 
@@ -38,7 +39,7 @@ class DumpRev extends Maintenance {
        }
 
        public function execute() {
-               $id = (int)$this->getArg();
+               $id = (int)$this->getArg( 0 );
 
                $lookup = MediaWikiServices::getInstance()->getRevisionLookup();
                $rev = $lookup->getRevisionById( $id );
@@ -46,13 +47,13 @@ class DumpRev extends Maintenance {
                        $this->fatalError( "Row not found" );
                }
 
-               $content = $rev->getContent( 'main' );
+               $content = $rev->getContent( SlotRecord::MAIN );
                if ( !$content ) {
                        $this->fatalError( "Text not found" );
                }
 
                $blobStore = MediaWikiServices::getInstance()->getBlobStore();
-               $slot = $rev->getSlot( 'main' );
+               $slot = $rev->getSlot( SlotRecord::MAIN );
                $text = $blobStore->getBlob( $slot->getAddress() );
 
                $this->output( "Text length: " . strlen( $text ) . "\n" );