addArg( 'rev-id', 'Revision ID', true ); } public function execute() { $id = (int)$this->getArg(); $lookup = MediaWikiServices::getInstance()->getRevisionLookup(); $rev = $lookup->getRevisionById( $id ); if ( !$rev ) { $this->fatalError( "Row not found" ); } $content = $rev->getContent( 'main' ); if ( !$content ) { $this->fatalError( "Text not found" ); } $blobStore = MediaWikiServices::getInstance()->getBlobStore(); $slot = $rev->getSlot( 'main' ); $text = $blobStore->getBlob( $slot->getAddress() ); $this->output( "Text length: " . strlen( $text ) . "\n" ); $this->output( substr( $text, 0, 100 ) . "\n" ); } } $maintClass = DumpRev::class; require_once RUN_MAINTENANCE_IF_MAIN;