Use MediaWikiServices (not OutputPage) to obtain a ResourceLoader
instance, then call ->getMessageBlobStore() to obtain its
MessageBlobStore instance (don't construct a new one).
Change-Id: I6b8bacac9888b5807328eece01134a6c5747dc72
$this->wanCache->touchCheckKey( $this->getCheckKey( $code ) );
// Purge the messages in the message blob store and fire any hook handlers
- $resourceloader = RequestContext::getMain()->getOutput()->getResourceLoader();
- $blobStore = $resourceloader->getMessageBlobStore();
+ $blobStore = MediaWikiServices::getInstance()->getResourceLoader()->getMessageBlobStore();
foreach ( $replacements as list( $title, $msg ) ) {
$blobStore->updateMessage( $this->contLang->lcfirst( $msg ) );
Hooks::run( 'MessageCacheReplace', [ $title, $newTextByTitle[$title] ] );
# HACK: If using a null (i.e. disabled) storage backend, we
# can't write to the MessageBlobStore either
if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) {
- $blobStore = new MessageBlobStore(
- MediaWikiServices::getInstance()->getResourceLoader()
- );
+ $blobStore = MediaWikiServices::getInstance()->getResourceLoader()->getMessageBlobStore();
$blobStore->clear();
}
}