/** @var NameTableStore */
private $contentModelStore;
+ /** @var NameTableStore */
+ private $slotRoleStore;
+
/** @var BlobStore */
private $blobStore;
private function initServices() {
$this->dbw = $this->getDB( DB_MASTER );
$this->contentModelStore = MediaWikiServices::getInstance()->getContentModelStore();
+ $this->slotRoleStore = MediaWikiServices::getInstance()->getSlotRoleStore();
$this->blobStore = MediaWikiServices::getInstance()->getBlobStore();
- $this->mainRoleId = MediaWikiServices::getInstance()->getSlotRoleStore()
- ->acquireId( SlotRecord::MAIN );
+
+ // Don't trust the cache for the NameTableStores, in case something went
+ // wrong during a previous run (see T224949#5325895).
+ $this->contentModelStore->reloadMap();
+ $this->slotRoleStore->reloadMap();
+ $this->mainRoleId = $this->slotRoleStore->acquireId( SlotRecord::MAIN );
}
public function execute() {
- global $wgMultiContentRevisionSchemaMigrationStage;
+ $multiContentRevisionSchemaMigrationStage =
+ $this->getConfig()->get( 'MultiContentRevisionSchemaMigrationStage' );
$t0 = microtime( true );
- if ( ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) === 0 ) {
+ if ( ( $multiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) === 0 ) {
$this->writeln(
'...cannot update while \$wgMultiContentRevisionSchemaMigrationStage '
. 'does not have the SCHEMA_COMPAT_WRITE_NEW bit set.'