*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Revision\SlotRecord;
require_once __DIR__ . '/../Maintenance.php';
}
public function execute() {
- $id = (int)$this->getArg();
+ $id = (int)$this->getArg( 0 );
$lookup = MediaWikiServices::getInstance()->getRevisionLookup();
$rev = $lookup->getRevisionById( $id );
$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" );