* @return string
*/
public static function getHelp( IContextSource $context, $modules, array $options ) {
- global $wgMemc, $wgContLang;
+ global $wgContLang;
if ( !is_array( $modules ) ) {
$modules = array( $modules );
}
$out->setPageTitle( $context->msg( 'api-help-title' ) );
+ $cache = ObjectCache::getMainWANInstance();
$cacheKey = null;
if ( count( $modules ) == 1 && $modules[0] instanceof ApiMain &&
$options['recursivesubmodules'] && $context->getLanguage() === $wgContLang
$cacheKey = wfMemcKey( 'apihelp', $modules[0]->getModulePath(),
(int)!empty( $options['toc'] ),
str_replace( ' ', '_', SpecialVersion::getVersion( 'nodb' ) ) );
- $cached = $wgMemc->get( $cacheKey );
+ $cached = $cache->get( $cacheKey );
if ( $cached ) {
$out->addHTML( $cached );
return;
$out->addHTML( $html );
if ( $cacheKey !== null ) {
- $wgMemc->set( $cacheKey, $out->getHTML(), $cacheHelpTimeout );
+ $cache->set( $cacheKey, $out->getHTML(), $cacheHelpTimeout );
}
}
return array(
'action=help'
=> 'apihelp-help-example-main',
+ 'action=help&modules=query&submodules=1'
+ => 'apihelp-help-example-submodules',
'action=help&recursivesubmodules=1'
=> 'apihelp-help-example-recursive',
'action=help&modules=help'