5 * Created on Aug 29, 2014
7 * Copyright © 2014 Brad Jorsch <bjorsch@wikimedia.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
28 * Class to output help for an API module
30 * @since 1.25 completely rewritten
33 class ApiHelp
extends ApiBase
{
34 public function execute() {
35 $params = $this->extractRequestParams();
38 foreach ( $params['modules'] as $path ) {
39 $modules[] = $this->getModuleFromPath( $path );
43 $context = new DerivativeContext( $this->getMain()->getContext() );
44 $context->setSkin( SkinFactory
::getDefaultInstance()->makeSkin( 'apioutput' ) );
45 $context->setLanguage( $this->getMain()->getLanguage() );
46 $context->setTitle( SpecialPage
::getTitleFor( 'ApiHelp' ) );
47 $out = new OutputPage( $context );
48 $out->setCopyrightUrl( 'https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright' );
49 $context->setOutput( $out );
51 self
::getHelp( $context, $modules, $params );
53 // Grab the output from the skin
55 $context->getOutput()->output();
56 $html = ob_get_clean();
58 $result = $this->getResult();
59 if ( $params['wrap'] ) {
61 'mime' => 'text/html',
64 ApiResult
::setSubelementsList( $data, 'help' );
65 $result->addValue( null, $this->getModuleName(), $data );
68 $result->addValue( null, 'text', $html, ApiResult
::NO_SIZE_CHECK
);
69 $result->addValue( null, 'mime', 'text/html', ApiResult
::NO_SIZE_CHECK
);
74 * Generate help for the specified modules
76 * Help is placed into the OutputPage object returned by
77 * $context->getOutput().
79 * Recognized options include:
80 * - headerlevel: (int) Header tag level
81 * - nolead: (bool) Skip the inclusion of api-help-lead
82 * - noheader: (bool) Skip the inclusion of the top-level section headers
83 * - submodules: (bool) Include help for submodules of the current module
84 * - recursivesubmodules: (bool) Include help for submodules recursively
85 * - helptitle: (string) Title to link for additional modules' help. Should contain $1.
86 * - toc: (bool) Include a table of contents
88 * @param IContextSource $context
89 * @param ApiBase[]|ApiBase $modules
90 * @param array $options Formatting options (described above)
93 public static function getHelp( IContextSource
$context, $modules, array $options ) {
96 if ( !is_array( $modules ) ) {
97 $modules = array( $modules );
100 $out = $context->getOutput();
101 $out->addModuleStyles( 'mediawiki.hlist' );
102 $out->addModuleStyles( 'mediawiki.apihelp' );
103 if ( !empty( $options['toc'] ) ) {
104 $out->addModules( 'mediawiki.toc' );
106 $out->setPageTitle( $context->msg( 'api-help-title' ) );
108 $cache = ObjectCache
::getMainWANInstance();
110 if ( count( $modules ) == 1 && $modules[0] instanceof ApiMain
&&
111 $options['recursivesubmodules'] && $context->getLanguage() === $wgContLang
113 $cacheHelpTimeout = $context->getConfig()->get( 'APICacheHelpTimeout' );
114 if ( $cacheHelpTimeout > 0 ) {
115 // Get help text from cache if present
116 $cacheKey = wfMemcKey( 'apihelp', $modules[0]->getModulePath(),
117 (int)!empty( $options['toc'] ),
118 str_replace( ' ', '_', SpecialVersion
::getVersion( 'nodb' ) ) );
119 $cached = $cache->get( $cacheKey );
121 $out->addHTML( $cached );
126 if ( $out->getHTML() !== '' ) {
127 // Don't save to cache, there's someone else's content in the page
132 $options['recursivesubmodules'] = !empty( $options['recursivesubmodules'] );
133 $options['submodules'] = $options['recursivesubmodules'] ||
!empty( $options['submodules'] );
136 if ( empty( $options['nolead'] ) ) {
137 $msg = $context->msg( 'api-help-lead' );
138 if ( !$msg->isDisabled() ) {
139 $out->addHTML( $msg->parseAsBlock() );
143 $haveModules = array();
144 $html = self
::getHelpInternal( $context, $modules, $options, $haveModules );
145 if ( !empty( $options['toc'] ) && $haveModules ) {
146 $out->addHTML( Linker
::generateTOC( $haveModules, $context->getLanguage() ) );
148 $out->addHTML( $html );
150 $helptitle = isset( $options['helptitle'] ) ?
$options['helptitle'] : null;
151 $html = self
::fixHelpLinks( $out->getHTML(), $helptitle, $haveModules );
153 $out->addHTML( $html );
155 if ( $cacheKey !== null ) {
156 $cache->set( $cacheKey, $out->getHTML(), $cacheHelpTimeout );
161 * Replace Special:ApiHelp links with links to api.php
163 * @param string $html
164 * @param string|null $helptitle Title to link to rather than api.php, must contain '$1'
165 * @param array $localModules Keys are modules to link within the current page, values are ignored
168 public static function fixHelpLinks( $html, $helptitle = null, $localModules = array() ) {
169 $formatter = new HtmlFormatter( $html );
170 $doc = $formatter->getDoc();
171 $xpath = new DOMXPath( $doc );
172 $nodes = $xpath->query( '//a[@href][not(contains(@class,\'apihelp-linktrail\'))]' );
173 foreach ( $nodes as $node ) {
174 $href = $node->getAttribute( 'href' );
177 $href = rawurldecode( $href );
178 } while ( $old !== $href );
179 if ( preg_match( '!Special:ApiHelp/([^&/|#]+)((?:#.*)?)!', $href, $m ) ) {
180 if ( isset( $localModules[$m[1]] ) ) {
181 $href = $m[2] === '' ?
'#' . $m[1] : $m[2];
182 } elseif ( $helptitle !== null ) {
183 $href = Title
::newFromText( str_replace( '$1', $m[1], $helptitle ) . $m[2] )
186 $href = wfAppendQuery( wfScript( 'api' ), array(
191 $node->setAttribute( 'href', $href );
192 $node->removeAttribute( 'title' );
196 return $formatter->getText();
200 * Wrap a message in HTML with a class.
202 * @param Message $msg
203 * @param string $class
207 private static function wrap( Message
$msg, $class, $tag = 'span' ) {
208 return Html
::rawElement( $tag, array( 'class' => $class ),
214 * Recursively-called function to actually construct the help
216 * @param IContextSource $context
217 * @param ApiBase[] $modules
218 * @param array $options
219 * @param array &$haveModules
222 private static function getHelpInternal( IContextSource
$context, array $modules,
223 array $options, &$haveModules
227 $level = empty( $options['headerlevel'] ) ?
2 : $options['headerlevel'];
228 if ( empty( $options['tocnumber'] ) ) {
229 $tocnumber = array( 2 => 0 );
231 $tocnumber = &$options['tocnumber'];
234 foreach ( $modules as $module ) {
235 $tocnumber[$level]++
;
236 $path = $module->getModulePath();
237 $module->setContext( $context );
248 if ( empty( $options['noheader'] ) ||
!empty( $options['toc'] ) ) {
251 while ( isset( $haveModules[$anchor] ) ) {
252 $anchor = $path . '|' . ++
$i;
255 if ( $module->isMain() ) {
256 $header = $context->msg( 'api-help-main-header' )->parse();
258 $name = $module->getModuleName();
259 $header = $module->getParent()->getModuleManager()->getModuleGroup( $name ) .
261 if ( $module->getModulePrefix() !== '' ) {
263 $context->msg( 'parentheses', $module->getModulePrefix() )->parse();
266 $haveModules[$anchor] = array(
267 'toclevel' => count( $tocnumber ),
271 'number' => join( '.', $tocnumber ),
274 if ( empty( $options['noheader'] ) ) {
275 $help['header'] .= Html
::element( 'h' . min( 6, $level ),
276 array( 'id' => $anchor, 'class' => 'apihelp-header' ),
281 $haveModules[$path] = true;
286 for ( $m = $module; $m !== null; $m = $m->getParent() ) {
287 $name = $m->getModuleName();
288 if ( $name === 'main_int' ) {
292 if ( count( $modules ) === 1 && $m === $modules[0] &&
293 !( !empty( $options['submodules'] ) && $m->getModuleManager() )
295 $link = Html
::element( 'b', null, $name );
297 $link = SpecialPage
::getTitleFor( 'ApiHelp', $m->getModulePath() )->getLocalURL();
298 $link = Html
::element( 'a',
299 array( 'href' => $link, 'class' => 'apihelp-linktrail' ),
304 array_unshift( $links, $link );
307 $help['header'] .= self
::wrap(
308 $context->msg( 'parentheses' )
309 ->rawParams( $context->getLanguage()->pipeList( $links ) ),
310 'apihelp-linktrail', 'div'
314 $flags = $module->getHelpFlags();
315 $help['flags'] .= Html
::openElement( 'div',
316 array( 'class' => 'apihelp-block apihelp-flags' ) );
317 $msg = $context->msg( 'api-help-flags' );
318 if ( !$msg->isDisabled() ) {
319 $help['flags'] .= self
::wrap(
320 $msg->numParams( count( $flags ) ), 'apihelp-block-head', 'div'
323 $help['flags'] .= Html
::openElement( 'ul' );
324 foreach ( $flags as $flag ) {
325 $help['flags'] .= Html
::rawElement( 'li', null,
326 self
::wrap( $context->msg( "api-help-flag-$flag" ), "apihelp-flag-$flag" )
329 $sourceInfo = $module->getModuleSourceInfo();
331 if ( isset( $sourceInfo['namemsg'] ) ) {
332 $extname = $context->msg( $sourceInfo['namemsg'] )->text();
334 $extname = $sourceInfo['name'];
336 $help['flags'] .= Html
::rawElement( 'li', null,
338 $context->msg( 'api-help-source', $extname, $sourceInfo['name'] ),
343 $link = SpecialPage
::getTitleFor( 'Version', 'License/' . $sourceInfo['name'] );
344 if ( isset( $sourceInfo['license-name'] ) ) {
345 $msg = $context->msg( 'api-help-license', $link, $sourceInfo['license-name'] );
346 } elseif ( SpecialVersion
::getExtLicenseFileName( dirname( $sourceInfo['path'] ) ) ) {
347 $msg = $context->msg( 'api-help-license-noname', $link );
349 $msg = $context->msg( 'api-help-license-unknown' );
351 $help['flags'] .= Html
::rawElement( 'li', null,
352 self
::wrap( $msg, 'apihelp-license' )
355 $help['flags'] .= Html
::rawElement( 'li', null,
356 self
::wrap( $context->msg( 'api-help-source-unknown' ), 'apihelp-source' )
358 $help['flags'] .= Html
::rawElement( 'li', null,
359 self
::wrap( $context->msg( 'api-help-license-unknown' ), 'apihelp-license' )
362 $help['flags'] .= Html
::closeElement( 'ul' );
363 $help['flags'] .= Html
::closeElement( 'div' );
365 foreach ( $module->getFinalDescription() as $msg ) {
366 $msg->setContext( $context );
367 $help['description'] .= $msg->parseAsBlock();
370 $urls = $module->getHelpUrls();
372 $help['help-urls'] .= Html
::openElement( 'div',
373 array( 'class' => 'apihelp-block apihelp-help-urls' )
375 $msg = $context->msg( 'api-help-help-urls' );
376 if ( !$msg->isDisabled() ) {
377 $help['help-urls'] .= self
::wrap(
378 $msg->numParams( count( $urls ) ), 'apihelp-block-head', 'div'
381 if ( !is_array( $urls ) ) {
382 $urls = array( $urls );
384 $help['help-urls'] .= Html
::openElement( 'ul' );
385 foreach ( $urls as $url ) {
386 $help['help-urls'] .= Html
::rawElement( 'li', null,
387 Html
::element( 'a', array( 'href' => $url ), $url )
390 $help['help-urls'] .= Html
::closeElement( 'ul' );
391 $help['help-urls'] .= Html
::closeElement( 'div' );
394 $params = $module->getFinalParams( ApiBase
::GET_VALUES_FOR_HELP
);
395 $dynamicParams = $module->dynamicParameterDocumentation();
397 if ( $params ||
$dynamicParams !== null ) {
398 $help['parameters'] .= Html
::openElement( 'div',
399 array( 'class' => 'apihelp-block apihelp-parameters' )
401 $msg = $context->msg( 'api-help-parameters' );
402 if ( !$msg->isDisabled() ) {
403 $help['parameters'] .= self
::wrap(
404 $msg->numParams( count( $params ) ), 'apihelp-block-head', 'div'
407 $help['parameters'] .= Html
::openElement( 'dl' );
409 $descriptions = $module->getFinalParamDescription();
411 foreach ( $params as $name => $settings ) {
412 if ( !is_array( $settings ) ) {
413 $settings = array( ApiBase
::PARAM_DFLT
=> $settings );
416 $help['parameters'] .= Html
::element( 'dt', null,
417 $module->encodeParamName( $name ) );
420 $description = array();
421 if ( isset( $descriptions[$name] ) ) {
422 foreach ( $descriptions[$name] as $msg ) {
423 $msg->setContext( $context );
424 $description[] = $msg->parseAsBlock();
432 if ( !empty( $settings[ApiBase
::PARAM_REQUIRED
] ) ) {
433 $info[] = $context->msg( 'api-help-param-required' )->parse();
437 if ( !empty( $settings[ApiBase
::PARAM_HELP_MSG_INFO
] ) ) {
438 foreach ( $settings[ApiBase
::PARAM_HELP_MSG_INFO
] as $i ) {
439 $tag = array_shift( $i );
440 $info[] = $context->msg( "apihelp-{$path}-paraminfo-{$tag}" )
441 ->numParams( count( $i ) )
442 ->params( $context->getLanguage()->commaList( $i ) )
443 ->params( $module->getModulePrefix() )
448 // Type documentation
449 if ( !isset( $settings[ApiBase
::PARAM_TYPE
] ) ) {
450 $dflt = isset( $settings[ApiBase
::PARAM_DFLT
] )
451 ?
$settings[ApiBase
::PARAM_DFLT
]
453 if ( is_bool( $dflt ) ) {
454 $settings[ApiBase
::PARAM_TYPE
] = 'boolean';
455 } elseif ( is_string( $dflt ) ||
is_null( $dflt ) ) {
456 $settings[ApiBase
::PARAM_TYPE
] = 'string';
457 } elseif ( is_int( $dflt ) ) {
458 $settings[ApiBase
::PARAM_TYPE
] = 'integer';
461 if ( isset( $settings[ApiBase
::PARAM_TYPE
] ) ) {
462 $type = $settings[ApiBase
::PARAM_TYPE
];
463 $multi = !empty( $settings[ApiBase
::PARAM_ISMULTI
] );
464 $hintPipeSeparated = true;
465 $count = ApiBase
::LIMIT_SML2 +
1;
467 if ( is_array( $type ) ) {
468 $count = count( $type );
469 $links = isset( $settings[ApiBase
::PARAM_VALUE_LINKS
] )
470 ?
$settings[ApiBase
::PARAM_VALUE_LINKS
]
472 $type = array_map( function ( $v ) use ( $links ) {
473 $ret = wfEscapeWikiText( $v );
474 if ( isset( $links[$v] ) ) {
475 $ret = "[[{$links[$v]}|$ret]]";
479 $i = array_search( '', $type, true );
480 if ( $i === false ) {
481 $type = $context->getLanguage()->commaList( $type );
484 $type = $context->msg( 'api-help-param-list-can-be-empty' )
485 ->numParams( count( $type ) )
486 ->params( $context->getLanguage()->commaList( $type ) )
489 $info[] = $context->msg( 'api-help-param-list' )
490 ->params( $multi ?
2 : 1 )
493 $hintPipeSeparated = false;
498 if ( isset( $settings[ApiBase
::PARAM_SUBMODULE_MAP
] ) ) {
499 $map = $settings[ApiBase
::PARAM_SUBMODULE_MAP
];
501 $submodules = array();
502 foreach ( $map as $v => $m ) {
503 $submodules[] = "[[Special:ApiHelp/{$m}|{$v}]]";
506 $submodules = $module->getModuleManager()->getNames( $name );
508 $prefix = $module->isMain()
509 ?
'' : ( $module->getModulePath() . '+' );
510 $submodules = array_map( function ( $name ) use ( $prefix ) {
511 return "[[Special:ApiHelp/{$prefix}{$name}|{$name}]]";
514 $count = count( $submodules );
515 $info[] = $context->msg( 'api-help-param-list' )
516 ->params( $multi ?
2 : 1 )
517 ->params( $context->getLanguage()->commaList( $submodules ) )
519 $hintPipeSeparated = false;
520 // No type message necessary, we have a list of values.
525 $namespaces = MWNamespace
::getValidNamespaces();
526 $count = count( $namespaces );
527 $info[] = $context->msg( 'api-help-param-list' )
528 ->params( $multi ?
2 : 1 )
529 ->params( $context->getLanguage()->commaList( $namespaces ) )
531 $hintPipeSeparated = false;
532 // No type message necessary, we have a list of values.
537 $tags = ChangeTags
::listExplicitlyDefinedTags();
538 $count = count( $tags );
539 $info[] = $context->msg( 'api-help-param-list' )
540 ->params( $multi ?
2 : 1 )
541 ->params( $context->getLanguage()->commaList( $tags ) )
543 $hintPipeSeparated = false;
548 if ( isset( $settings[ApiBase
::PARAM_MAX2
] ) ) {
549 $info[] = $context->msg( 'api-help-param-limit2' )
550 ->numParams( $settings[ApiBase
::PARAM_MAX
] )
551 ->numParams( $settings[ApiBase
::PARAM_MAX2
] )
554 $info[] = $context->msg( 'api-help-param-limit' )
555 ->numParams( $settings[ApiBase
::PARAM_MAX
] )
561 // Possible messages:
562 // api-help-param-integer-min,
563 // api-help-param-integer-max,
564 // api-help-param-integer-minmax
567 if ( isset( $settings[ApiBase
::PARAM_MIN
] ) ) {
569 $min = $settings[ApiBase
::PARAM_MIN
];
571 if ( isset( $settings[ApiBase
::PARAM_MAX
] ) ) {
573 $max = $settings[ApiBase
::PARAM_MAX
];
575 if ( $suffix !== '' ) {
577 $context->msg( "api-help-param-integer-$suffix" )
578 ->params( $multi ?
2 : 1 )
579 ->numParams( $min, $max )
585 $info[] = $context->msg( 'api-help-param-upload' )
587 // No type message necessary, api-help-param-upload should handle it.
593 // Displaying a type message here would be useless.
599 // Add type. Messages for grep: api-help-param-type-limit
600 // api-help-param-type-integer api-help-param-type-boolean
601 // api-help-param-type-timestamp api-help-param-type-user
602 // api-help-param-type-password
603 if ( is_string( $type ) ) {
604 $msg = $context->msg( "api-help-param-type-$type" );
605 if ( !$msg->isDisabled() ) {
606 $info[] = $msg->params( $multi ?
2 : 1 )->parse();
612 if ( $hintPipeSeparated ) {
613 $extra[] = $context->msg( 'api-help-param-multi-separate' )->parse();
615 if ( $count > ApiBase
::LIMIT_SML1
) {
616 $extra[] = $context->msg( 'api-help-param-multi-max' )
617 ->numParams( ApiBase
::LIMIT_SML1
, ApiBase
::LIMIT_SML2
)
621 $info[] = join( ' ', $extra );
627 $default = isset( $settings[ApiBase
::PARAM_DFLT
] )
628 ?
$settings[ApiBase
::PARAM_DFLT
]
630 if ( $default === '' ) {
631 $info[] = $context->msg( 'api-help-param-default-empty' )
633 } elseif ( $default !== null && $default !== false ) {
634 $info[] = $context->msg( 'api-help-param-default' )
635 ->params( wfEscapeWikiText( $default ) )
639 if ( !array_filter( $description ) ) {
640 $description = array( self
::wrap(
641 $context->msg( 'api-help-param-no-description' ),
646 // Add "deprecated" flag
647 if ( !empty( $settings[ApiBase
::PARAM_DEPRECATED
] ) ) {
648 $help['parameters'] .= Html
::openElement( 'dd',
649 array( 'class' => 'info' ) );
650 $help['parameters'] .= self
::wrap(
651 $context->msg( 'api-help-param-deprecated' ),
652 'apihelp-deprecated', 'strong'
654 $help['parameters'] .= Html
::closeElement( 'dd' );
657 if ( $description ) {
658 $description = join( '', $description );
659 $description = preg_replace( '!\s*</([oud]l)>\s*<\1>\s*!', "\n", $description );
660 $help['parameters'] .= Html
::rawElement( 'dd',
661 array( 'class' => 'description' ), $description );
664 foreach ( $info as $i ) {
665 $help['parameters'] .= Html
::rawElement( 'dd', array( 'class' => 'info' ), $i );
669 if ( $dynamicParams !== null ) {
670 $dynamicParams = ApiBase
::makeMessage( $dynamicParams, $context, array(
671 $module->getModulePrefix(),
672 $module->getModuleName(),
673 $module->getModulePath()
675 $help['parameters'] .= Html
::element( 'dt', null, '*' );
676 $help['parameters'] .= Html
::rawElement( 'dd',
677 array( 'class' => 'description' ), $dynamicParams->parse() );
680 $help['parameters'] .= Html
::closeElement( 'dl' );
681 $help['parameters'] .= Html
::closeElement( 'div' );
684 $examples = $module->getExamplesMessages();
686 $help['examples'] .= Html
::openElement( 'div',
687 array( 'class' => 'apihelp-block apihelp-examples' ) );
688 $msg = $context->msg( 'api-help-examples' );
689 if ( !$msg->isDisabled() ) {
690 $help['examples'] .= self
::wrap(
691 $msg->numParams( count( $examples ) ), 'apihelp-block-head', 'div'
695 $help['examples'] .= Html
::openElement( 'dl' );
696 foreach ( $examples as $qs => $msg ) {
697 $msg = ApiBase
::makeMessage( $msg, $context, array(
698 $module->getModulePrefix(),
699 $module->getModuleName(),
700 $module->getModulePath()
703 $link = wfAppendQuery( wfScript( 'api' ), $qs );
704 $sandbox = SpecialPage
::getTitleFor( 'ApiSandbox' )->getLocalURL() . '#' . $qs;
705 $help['examples'] .= Html
::rawElement( 'dt', null, $msg->parse() );
706 $help['examples'] .= Html
::rawElement( 'dd', null,
707 Html
::element( 'a', array( 'href' => $link ), "api.php?$qs" ) . ' ' .
708 Html
::rawElement( 'a', array( 'href' => $sandbox ),
709 $context->msg( 'api-help-open-in-apisandbox' )->parse() )
712 $help['examples'] .= Html
::closeElement( 'dl' );
713 $help['examples'] .= Html
::closeElement( 'div' );
716 $subtocnumber = $tocnumber;
717 $subtocnumber[$level +
1] = 0;
719 'submodules' => $options['recursivesubmodules'],
720 'headerlevel' => $level +
1,
721 'tocnumber' => &$subtocnumber,
725 if ( $options['submodules'] && $module->getModuleManager() ) {
726 $manager = $module->getModuleManager();
727 $submodules = array();
728 foreach ( $groups as $group ) {
729 $names = $manager->getNames( $group );
731 foreach ( $names as $name ) {
732 $submodules[] = $manager->getModule( $name );
735 $help['submodules'] .= self
::getHelpInternal(
743 $module->modifyHelp( $help, $suboptions, $haveModules );
745 Hooks
::run( 'APIHelpModifyOutput', array( $module, &$help, $suboptions, &$haveModules ) );
747 $out .= join( "\n", $help );
753 public function shouldCheckMaxlag() {
757 public function isReadMode() {
761 public function getCustomPrinter() {
762 $params = $this->extractRequestParams();
763 if ( $params['wrap'] ) {
767 $main = $this->getMain();
768 $errorPrinter = $main->createPrinterByName( $main->getParameter( 'format' ) );
769 return new ApiFormatRaw( $main, $errorPrinter );
772 public function getAllowedParams() {
775 ApiBase
::PARAM_DFLT
=> 'main',
776 ApiBase
::PARAM_ISMULTI
=> true,
778 'submodules' => false,
779 'recursivesubmodules' => false,
785 protected function getExamplesMessages() {
788 => 'apihelp-help-example-main',
789 'action=help&modules=query&submodules=1'
790 => 'apihelp-help-example-submodules',
791 'action=help&recursivesubmodules=1'
792 => 'apihelp-help-example-recursive',
793 'action=help&modules=help'
794 => 'apihelp-help-example-help',
795 'action=help&modules=query+info|query+categorymembers'
796 => 'apihelp-help-example-query',
800 public function getHelpUrls() {
802 'https://www.mediawiki.org/wiki/API:Main_page',
803 'https://www.mediawiki.org/wiki/API:FAQ',
804 'https://www.mediawiki.org/wiki/API:Quick_start_guide',