From 801a5a7492ea1dda71900255d65bb25a7bfc649f Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 22 Sep 2018 15:47:03 +0200 Subject: [PATCH] Fix caller name in Title::loadRestrictions Seeing {closure} in the logs as caller is not helpful Change-Id: I34aead30c55aefb7591cbc6031522d0f0e5bd17a --- includes/Title.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index bbc1d63145..369e15ac0e 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3354,11 +3354,12 @@ class Title implements LinkTarget { $id = $this->getArticleID(); if ( $id ) { $cache = ObjectCache::getMainWANInstance(); + $fname = __METHOD__; $rows = $cache->getWithSetCallback( // Page protections always leave a new null revision $cache->makeKey( 'page-restrictions', $id, $this->getLatestRevID() ), $cache::TTL_DAY, - function ( $curValue, &$ttl, array &$setOpts ) { + function ( $curValue, &$ttl, array &$setOpts ) use ( $fname ) { $dbr = wfGetDB( DB_REPLICA ); $setOpts += Database::getCacheSetOptions( $dbr ); @@ -3368,7 +3369,7 @@ class Title implements LinkTarget { 'page_restrictions', [ 'pr_type', 'pr_expiry', 'pr_level', 'pr_cascade' ], [ 'pr_page' => $this->getArticleID() ], - __METHOD__ + $fname ) ); } -- 2.20.1