From: Kunal Mehta Date: Tue, 23 May 2017 04:37:33 +0000 (-0700) Subject: ApiHelp: Avoid deprecated ObjectCache::getMainWANInstance() X-Git-Tag: 1.31.0-rc.0~3186 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=42c91fe7fa313de3b1bd7a2794c7a07adf74aab9;p=lhc%2Fweb%2Fwiklou.git ApiHelp: Avoid deprecated ObjectCache::getMainWANInstance() And switch wfMemcKey() to $cache->makeKey() while we're at it. Change-Id: I4e37fbe1ddd49cc7583dd0f2f950eaf21c9ef050 --- diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index df9ca981ef..7cd6d58b35 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -25,6 +25,7 @@ */ use HtmlFormatter\HtmlFormatter; +use MediaWiki\MediaWikiServices; /** * Class to output help for an API module @@ -108,7 +109,7 @@ class ApiHelp extends ApiBase { } $out->setPageTitle( $context->msg( 'api-help-title' ) ); - $cache = ObjectCache::getMainWANInstance(); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $cacheKey = null; if ( count( $modules ) == 1 && $modules[0] instanceof ApiMain && $options['recursivesubmodules'] && $context->getLanguage() === $wgContLang @@ -116,7 +117,7 @@ class ApiHelp extends ApiBase { $cacheHelpTimeout = $context->getConfig()->get( 'APICacheHelpTimeout' ); if ( $cacheHelpTimeout > 0 ) { // Get help text from cache if present - $cacheKey = wfMemcKey( 'apihelp', $modules[0]->getModulePath(), + $cacheKey = $cache->makeKey( 'apihelp', $modules[0]->getModulePath(), (int)!empty( $options['toc'] ), str_replace( ' ', '_', SpecialVersion::getVersion( 'nodb' ) ) ); $cached = $cache->get( $cacheKey );