Fix caller name in File::getDescriptionText
authorUmherirrender <umherirrender_de.wp@web.de>
Sun, 30 Sep 2018 14:52:06 +0000 (16:52 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sun, 30 Sep 2018 14:52:06 +0000 (16:52 +0200)
Seeing {closure} in the logs as caller is not helpful

Change-Id: I415e2bb691650bc34adfb750c7a70a5d29176849

includes/filerepo/file/File.php
includes/filerepo/file/ForeignDBFile.php

index 5a0cf6a..a30d213 100644 (file)
@@ -2071,13 +2071,14 @@ abstract class File implements IDBAccessObject {
                                $lang->getCode(),
                                md5( $this->getName() )
                        );
+                       $fname = __METHOD__;
 
                        return $cache->getWithSetCallback(
                                $key,
                                $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
-                               function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) {
+                               function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
                                        wfDebug( "Fetching shared description from $renderUrl\n" );
-                                       $res = Http::get( $renderUrl, [], __METHOD__ );
+                                       $res = Http::get( $renderUrl, [], $fname );
                                        if ( !$res ) {
                                                $ttl = WANObjectCache::TTL_UNCACHEABLE;
                                        }
index ee4df1d..1869967 100644 (file)
@@ -152,6 +152,7 @@ class ForeignDBFile extends LocalFile {
                }
 
                $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+               $fname = __METHOD__;
 
                return $cache->getWithSetCallback(
                        $this->repo->getLocalCacheKey(
@@ -161,9 +162,9 @@ class ForeignDBFile extends LocalFile {
                                $touched
                        ),
                        $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
-                       function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) {
+                       function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
                                wfDebug( "Fetching shared description from $renderUrl\n" );
-                               $res = Http::get( $renderUrl, [], __METHOD__ );
+                               $res = Http::get( $renderUrl, [], $fname );
                                if ( !$res ) {
                                        $ttl = WANObjectCache::TTL_UNCACHEABLE;
                                }