summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Babel/includes/BabelStatic.php')
-rw-r--r--MLEB/Babel/includes/BabelStatic.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/MLEB/Babel/includes/BabelStatic.php b/MLEB/Babel/includes/BabelStatic.php
index 20b3226e..c5c64fbc 100644
--- a/MLEB/Babel/includes/BabelStatic.php
+++ b/MLEB/Babel/includes/BabelStatic.php
@@ -86,7 +86,13 @@ class BabelStatic {
$cache->touchCheckKey( $cache->makeKey( 'babel-local-languages', $user->getId() ) );
if ( $wgBabelCentralDb === wfWikiID() ) {
// If this is the central wiki, invalidate all of the local caches
- $centralId = CentralIdLookup::factory()->centralIdFromLocalUser( $user );
+ if ( method_exists( MediaWikiServices::class, 'getCentralIdLookupFactory' ) ) {
+ // MW1.37+
+ $centralId = MediaWikiServices::getInstance()->getCentralIdLookupFactory()
+ ->getLookup()->centralIdFromLocalUser( $user );
+ } else {
+ $centralId = CentralIdLookup::factory()->centralIdFromLocalUser( $user );
+ }
if ( $centralId ) {
$cache->touchCheckKey( $cache->makeGlobalKey( 'babel-central-languages', $centralId ) );
}