- global $wgLocalDatabases, $wgDBname, $wgEnableSidebarCache, $messageMemc;
- if ( $wgLocalDatabases ) {
- $databases = $wgLocalDatabases;
- } else {
- $databases = [ $wgDBname ];
- }
-
- foreach ( $databases as $db ) {
- $this->output( "Deleting message cache for {$db}... " );
- $messageMemc->delete( "{$db}:messages" );
- if ( $wgEnableSidebarCache ) {
- $messageMemc->delete( "{$db}:sidebar" );
- }
- $this->output( "Deleted\n" );
- }
+ $this->output( "Purging message cache for all languages on this wiki... " );
+ $messageCache = MediaWikiServices::getInstance()->getMessageCache();
+ $messageCache->clear();
+ $this->output( "Done\n" );