Fix caller name in ClassicInterwikiLookup::load
authorUmherirrender <umherirrender_de.wp@web.de>
Sun, 30 Sep 2018 11:09:46 +0000 (13:09 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sun, 30 Sep 2018 11:09:46 +0000 (13:09 +0200)
Seeing MediaWiki\Interwiki\{closure} in the logs as caller is not
helpful

Change-Id: I39af68a02d40667e428c7f30c88aacab8a02cd86

includes/interwiki/ClassicInterwikiLookup.php

index 05cf933..cdf4cde 100644 (file)
@@ -279,10 +279,11 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                        }
                }
 
+               $fname = __METHOD__;
                $iwData = $this->objectCache->getWithSetCallback(
                        $this->objectCache->makeKey( 'interwiki', $prefix ),
                        $this->objectCacheExpiry,
-                       function ( $oldValue, &$ttl, array &$setOpts ) use ( $prefix ) {
+                       function ( $oldValue, &$ttl, array &$setOpts ) use ( $prefix, $fname ) {
                                $dbr = wfGetDB( DB_REPLICA ); // TODO: inject LoadBalancer
 
                                $setOpts += Database::getCacheSetOptions( $dbr );
@@ -291,7 +292,7 @@ class ClassicInterwikiLookup implements InterwikiLookup {
                                        'interwiki',
                                        self::selectFields(),
                                        [ 'iw_prefix' => $prefix ],
-                                       __METHOD__
+                                       $fname
                                );
 
                                return $row ? (array)$row : '!NONEXISTENT';