5 * Created on Sep 7, 2006
7 * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
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 * This is the main query class. It behaves similar to ApiMain: based on the
29 * parameters given, it will create a list of titles to work on (an ApiPageSet
30 * object), instantiate and execute various property/list/meta modules, and
31 * assemble all resulting data into a single ApiResult object.
33 * In generator mode, a generator will be executed first to populate a second
34 * ApiPageSet object, and that object will be used for all subsequent modules.
38 class ApiQuery
extends ApiBase
{
41 * List of Api Query prop modules
44 private static $QueryPropModules = array(
45 'categories' => 'ApiQueryCategories',
46 'categoryinfo' => 'ApiQueryCategoryInfo',
47 'duplicatefiles' => 'ApiQueryDuplicateFiles',
48 'extlinks' => 'ApiQueryExternalLinks',
49 'images' => 'ApiQueryImages',
50 'imageinfo' => 'ApiQueryImageInfo',
51 'info' => 'ApiQueryInfo',
52 'links' => 'ApiQueryLinks',
53 'iwlinks' => 'ApiQueryIWLinks',
54 'langlinks' => 'ApiQueryLangLinks',
55 'pageprops' => 'ApiQueryPageProps',
56 'revisions' => 'ApiQueryRevisions',
57 'stashimageinfo' => 'ApiQueryStashImageInfo',
58 'templates' => 'ApiQueryLinks',
62 * List of Api Query list modules
65 private static $QueryListModules = array(
66 'allcategories' => 'ApiQueryAllCategories',
67 'allimages' => 'ApiQueryAllImages',
68 'alllinks' => 'ApiQueryAllLinks',
69 'allpages' => 'ApiQueryAllPages',
70 'alltransclusions' => 'ApiQueryAllLinks',
71 'allusers' => 'ApiQueryAllUsers',
72 'backlinks' => 'ApiQueryBacklinks',
73 'blocks' => 'ApiQueryBlocks',
74 'categorymembers' => 'ApiQueryCategoryMembers',
75 'deletedrevs' => 'ApiQueryDeletedrevs',
76 'embeddedin' => 'ApiQueryBacklinks',
77 'exturlusage' => 'ApiQueryExtLinksUsage',
78 'filearchive' => 'ApiQueryFilearchive',
79 'imageusage' => 'ApiQueryBacklinks',
80 'iwbacklinks' => 'ApiQueryIWBacklinks',
81 'langbacklinks' => 'ApiQueryLangBacklinks',
82 'logevents' => 'ApiQueryLogEvents',
83 'protectedtitles' => 'ApiQueryProtectedTitles',
84 'querypage' => 'ApiQueryQueryPage',
85 'random' => 'ApiQueryRandom',
86 'recentchanges' => 'ApiQueryRecentChanges',
87 'search' => 'ApiQuerySearch',
88 'tags' => 'ApiQueryTags',
89 'usercontribs' => 'ApiQueryContributions',
90 'users' => 'ApiQueryUsers',
91 'watchlist' => 'ApiQueryWatchlist',
92 'watchlistraw' => 'ApiQueryWatchlistRaw',
96 * List of Api Query meta modules
99 private static $QueryMetaModules = array(
100 'allmessages' => 'ApiQueryAllMessages',
101 'siteinfo' => 'ApiQuerySiteinfo',
102 'userinfo' => 'ApiQueryUserInfo',
106 * List of Api Query generator modules
107 * Defined in code, rather than being derived at runtime,
108 * due to performance reasons
111 private $mQueryGenerators = array(
112 'allcategories' => 'ApiQueryAllCategories',
113 'allimages' => 'ApiQueryAllImages',
114 'alllinks' => 'ApiQueryAllLinks',
115 'allpages' => 'ApiQueryAllPages',
116 'alltransclusions' => 'ApiQueryAllLinks',
117 'backlinks' => 'ApiQueryBacklinks',
118 'categories' => 'ApiQueryCategories',
119 'categorymembers' => 'ApiQueryCategoryMembers',
120 'duplicatefiles' => 'ApiQueryDuplicateFiles',
121 'embeddedin' => 'ApiQueryBacklinks',
122 'exturlusage' => 'ApiQueryExtLinksUsage',
123 'images' => 'ApiQueryImages',
124 'imageusage' => 'ApiQueryBacklinks',
125 'iwbacklinks' => 'ApiQueryIWBacklinks',
126 'langbacklinks' => 'ApiQueryLangBacklinks',
127 'links' => 'ApiQueryLinks',
128 'protectedtitles' => 'ApiQueryProtectedTitles',
129 'querypage' => 'ApiQueryQueryPage',
130 'random' => 'ApiQueryRandom',
131 'recentchanges' => 'ApiQueryRecentChanges',
132 'search' => 'ApiQuerySearch',
133 'templates' => 'ApiQueryLinks',
134 'watchlist' => 'ApiQueryWatchlist',
135 'watchlistraw' => 'ApiQueryWatchlistRaw',
143 private $params, $redirects, $convertTitles, $iwUrl;
144 private $mSlaveDB = null;
145 private $mNamedDB = array();
148 protected $mAllowedGenerators;
151 * @param $main ApiMain
152 * @param $action string
154 public function __construct( $main, $action ) {
155 parent
::__construct( $main, $action );
157 $this->mModuleMgr
= new ApiModuleManager( $this );
159 // Allow custom modules to be added in LocalSettings.php
160 global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules;
161 $this->mModuleMgr
->addModules( self
::$QueryPropModules, 'prop' );
162 $this->mModuleMgr
->addModules( $wgAPIPropModules, 'prop' );
163 $this->mModuleMgr
->addModules( self
::$QueryListModules, 'list' );
164 $this->mModuleMgr
->addModules( $wgAPIListModules, 'list' );
165 $this->mModuleMgr
->addModules( self
::$QueryMetaModules, 'meta' );
166 $this->mModuleMgr
->addModules( $wgAPIMetaModules, 'meta' );
168 global $wgAPIGeneratorModules;
169 if ( is_array( $wgAPIGeneratorModules ) ) {
170 foreach ( $wgAPIGeneratorModules as $moduleName => $moduleClass ) {
171 $this->mQueryGenerators
[$moduleName] = $moduleClass;
174 $this->mAllowedGenerators
= array_keys( $this->mQueryGenerators
);
178 * Overrides to return this instance's module manager.
179 * @return ApiModuleManager
181 public function getModuleManager() {
182 return $this->mModuleMgr
;
186 * Gets a default slave database connection object
187 * @return DatabaseBase
189 public function getDB() {
190 if ( !isset( $this->mSlaveDB
) ) {
191 $this->profileDBIn();
192 $this->mSlaveDB
= wfGetDB( DB_SLAVE
, 'api' );
193 $this->profileDBOut();
195 return $this->mSlaveDB
;
199 * Get the query database connection with the given name.
200 * If no such connection has been requested before, it will be created.
201 * Subsequent calls with the same $name will return the same connection
202 * as the first, regardless of the values of $db and $groups
203 * @param $name string Name to assign to the database connection
204 * @param $db int One of the DB_* constants
205 * @param $groups array Query groups
206 * @return DatabaseBase
208 public function getNamedDB( $name, $db, $groups ) {
209 if ( !array_key_exists( $name, $this->mNamedDB
) ) {
210 $this->profileDBIn();
211 $this->mNamedDB
[$name] = wfGetDB( $db, $groups );
212 $this->profileDBOut();
214 return $this->mNamedDB
[$name];
218 * Gets the set of pages the user has requested (or generated)
221 public function getPageSet() {
222 return $this->mPageSet
;
226 * Get the array mapping module names to class names
227 * @deprecated since 1.21, use getModuleManager()'s methods instead
228 * @return array array(modulename => classname)
230 public function getModules() {
231 return $this->getModuleManager()->getNamesWithClasses();
235 * Get the generators array mapping module names to class names
236 * @return array array(modulename => classname)
238 public function getGenerators() {
239 return $this->mQueryGenerators
;
243 * Get whether the specified module is a prop, list or a meta query module
244 * @deprecated since 1.21, use getModuleManager()->getModuleGroup()
245 * @param $moduleName string Name of the module to find type for
246 * @return mixed string or null
248 function getModuleType( $moduleName ) {
249 return $this->getModuleManager()->getModuleGroup( $moduleName );
253 * @return ApiFormatRaw|null
255 public function getCustomPrinter() {
256 // If &exportnowrap is set, use the raw formatter
257 if ( $this->getParameter( 'export' ) &&
258 $this->getParameter( 'exportnowrap' ) )
260 return new ApiFormatRaw( $this->getMain(),
261 $this->getMain()->createPrinterByName( 'xml' ) );
268 * Query execution happens in the following steps:
269 * #1 Create a PageSet object with any pages requested by the user
270 * #2 If using a generator, execute it to get a new ApiPageSet object
271 * #3 Instantiate all requested modules.
272 * This way the PageSet object will know what shared data is required,
273 * and minimize DB calls.
274 * #4 Output all normalization and redirect resolution information
275 * #5 Execute all requested modules
277 public function execute() {
278 $this->params
= $this->extractRequestParams();
279 $this->redirects
= $this->params
['redirects'];
280 $this->convertTitles
= $this->params
['converttitles'];
281 $this->iwUrl
= $this->params
['iwurl'];
284 $this->mPageSet
= new ApiPageSet( $this, $this->redirects
, $this->convertTitles
);
286 // Instantiate requested modules
288 $this->instantiateModules( $modules, 'prop' );
289 $this->instantiateModules( $modules, 'list' );
290 $this->instantiateModules( $modules, 'meta' );
292 $cacheMode = 'public';
294 // If given, execute generator to substitute user supplied data with generated data.
295 if ( isset( $this->params
['generator'] ) ) {
296 $generator = $this->newGenerator( $this->params
['generator'] );
297 $params = $generator->extractRequestParams();
298 $cacheMode = $this->mergeCacheMode( $cacheMode,
299 $generator->getCacheMode( $params ) );
300 $this->executeGeneratorModule( $generator, $modules );
302 // Append custom fields and populate page/revision information
303 $this->addCustomFldsToPageSet( $modules, $this->mPageSet
);
304 $this->mPageSet
->execute();
307 // Record page information (title, namespace, if exists, etc)
308 $this->outputGeneralPageInfo();
310 // Execute all requested modules.
312 * @var $module ApiQueryBase
314 foreach ( $modules as $module ) {
315 $params = $module->extractRequestParams();
316 $cacheMode = $this->mergeCacheMode(
317 $cacheMode, $module->getCacheMode( $params ) );
318 $module->profileIn();
320 wfRunHooks( 'APIQueryAfterExecute', array( &$module ) );
321 $module->profileOut();
324 // Set the cache mode
325 $this->getMain()->setCacheMode( $cacheMode );
329 * Update a cache mode string, applying the cache mode of a new module to it.
330 * The cache mode may increase in the level of privacy, but public modules
331 * added to private data do not decrease the level of privacy.
333 * @param $cacheMode string
334 * @param $modCacheMode string
337 protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
338 if ( $modCacheMode === 'anon-public-user-private' ) {
339 if ( $cacheMode !== 'private' ) {
340 $cacheMode = 'anon-public-user-private';
342 } elseif ( $modCacheMode === 'public' ) {
343 // do nothing, if it's public already it will stay public
345 $cacheMode = 'private';
351 * Query modules may optimize data requests through the $this->getPageSet() object
352 * by adding extra fields from the page table.
353 * This function will gather all the extra request fields from the modules.
354 * @param $modules array of module objects
355 * @param $pageSet ApiPageSet
357 private function addCustomFldsToPageSet( $modules, $pageSet ) {
358 // Query all requested modules.
360 * @var $module ApiQueryBase
362 foreach ( $modules as $module ) {
363 $module->requestExtraData( $pageSet );
368 * Create instances of all modules requested by the client
369 * @param $modules Array to append instantiated modules to
370 * @param $param string Parameter name to read modules from
372 private function instantiateModules( &$modules, $param ) {
373 if ( isset( $this->params
[$param] ) ) {
374 foreach ( $this->params
[$param] as $moduleName ) {
375 $modules[] = $this->mModuleMgr
->getModule( $moduleName );
381 * Appends an element for each page in the current pageSet with the
382 * most general information (id, title), plus any title normalizations
383 * and missing or invalid title/pageids/revids.
385 private function outputGeneralPageInfo() {
386 $pageSet = $this->getPageSet();
387 $result = $this->getResult();
389 // We don't check for a full result set here because we can't be adding
390 // more than 380K. The maximum revision size is in the megabyte range,
391 // and the maximum result size must be even higher than that.
393 // Title normalizations
394 $normValues = array();
395 foreach ( $pageSet->getNormalizedTitles() as $rawTitleStr => $titleStr ) {
396 $normValues[] = array(
397 'from' => $rawTitleStr,
402 if ( count( $normValues ) ) {
403 $result->setIndexedTagName( $normValues, 'n' );
404 $result->addValue( 'query', 'normalized', $normValues );
408 $convValues = array();
409 foreach ( $pageSet->getConvertedTitles() as $rawTitleStr => $titleStr ) {
410 $convValues[] = array(
411 'from' => $rawTitleStr,
416 if ( count( $convValues ) ) {
417 $result->setIndexedTagName( $convValues, 'c' );
418 $result->addValue( 'query', 'converted', $convValues );
422 $intrwValues = array();
423 foreach ( $pageSet->getInterwikiTitles() as $rawTitleStr => $interwikiStr ) {
425 'title' => $rawTitleStr,
426 'iw' => $interwikiStr,
428 if ( $this->iwUrl
) {
429 $title = Title
::newFromText( $rawTitleStr );
430 $item['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT
);
432 $intrwValues[] = $item;
435 if ( count( $intrwValues ) ) {
436 $result->setIndexedTagName( $intrwValues, 'i' );
437 $result->addValue( 'query', 'interwiki', $intrwValues );
440 // Show redirect information
441 $redirValues = array();
443 * @var $titleTo Title
445 foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleTo ) {
447 'from' => strval( $titleStrFrom ),
448 'to' => $titleTo->getPrefixedText(),
450 if ( $titleTo->getFragment() !== '' ) {
451 $r['tofragment'] = $titleTo->getFragment();
456 if ( count( $redirValues ) ) {
457 $result->setIndexedTagName( $redirValues, 'r' );
458 $result->addValue( 'query', 'redirects', $redirValues );
461 // Missing revision elements
462 $missingRevIDs = $pageSet->getMissingRevisionIDs();
463 if ( count( $missingRevIDs ) ) {
465 foreach ( $missingRevIDs as $revid ) {
466 $revids[$revid] = array(
470 $result->setIndexedTagName( $revids, 'rev' );
471 $result->addValue( 'query', 'badrevids', $revids );
477 // Report any missing titles
478 foreach ( $pageSet->getMissingTitles() as $fakeId => $title ) {
480 ApiQueryBase
::addTitleInfo( $vals, $title );
481 $vals['missing'] = '';
482 $pages[$fakeId] = $vals;
484 // Report any invalid titles
485 foreach ( $pageSet->getInvalidTitles() as $fakeId => $title ) {
486 $pages[$fakeId] = array( 'title' => $title, 'invalid' => '' );
488 // Report any missing page ids
489 foreach ( $pageSet->getMissingPageIDs() as $pageid ) {
490 $pages[$pageid] = array(
495 // Report special pages
496 foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) {
498 ApiQueryBase
::addTitleInfo( $vals, $title );
499 $vals['special'] = '';
500 if ( $title->isSpecialPage() &&
501 !SpecialPageFactory
::exists( $title->getDbKey() ) ) {
502 $vals['missing'] = '';
503 } elseif ( $title->getNamespace() == NS_MEDIA
&&
504 !wfFindFile( $title ) ) {
505 $vals['missing'] = '';
507 $pages[$fakeId] = $vals;
510 // Output general page information for found titles
511 foreach ( $pageSet->getGoodTitles() as $pageid => $title ) {
513 $vals['pageid'] = $pageid;
514 ApiQueryBase
::addTitleInfo( $vals, $title );
515 $pages[$pageid] = $vals;
518 if ( count( $pages ) ) {
519 if ( $this->params
['indexpageids'] ) {
520 $pageIDs = array_keys( $pages );
521 // json treats all map keys as strings - converting to match
522 $pageIDs = array_map( 'strval', $pageIDs );
523 $result->setIndexedTagName( $pageIDs, 'id' );
524 $result->addValue( 'query', 'pageids', $pageIDs );
527 $result->setIndexedTagName( $pages, 'page' );
528 $result->addValue( 'query', 'pages', $pages );
530 if ( $this->params
['export'] ) {
531 $this->doExport( $pageSet, $result );
536 * @param $pageSet ApiPageSet Pages to be exported
537 * @param $result ApiResult Result to output to
539 private function doExport( $pageSet, $result ) {
540 $exportTitles = array();
541 $titles = $pageSet->getGoodTitles();
542 if ( count( $titles ) ) {
543 $user = $this->getUser();
544 foreach ( $titles as $title ) {
545 if ( $title->userCan( 'read', $user ) ) {
546 $exportTitles[] = $title;
551 $exporter = new WikiExporter( $this->getDB() );
552 // WikiExporter writes to stdout, so catch its
555 $exporter->openStream();
556 foreach ( $exportTitles as $title ) {
557 $exporter->pageByTitle( $title );
559 $exporter->closeStream();
560 $exportxml = ob_get_contents();
563 // Don't check the size of exported stuff
564 // It's not continuable, so it would cause more
565 // problems than it'd solve
566 $result->disableSizeCheck();
567 if ( $this->params
['exportnowrap'] ) {
569 // Raw formatter will handle this
570 $result->addValue( null, 'text', $exportxml );
571 $result->addValue( null, 'mime', 'text/xml' );
574 ApiResult
::setContent( $r, $exportxml );
575 $result->addValue( 'query', 'export', $r );
577 $result->enableSizeCheck();
581 * Create a generator object of the given type and return it
582 * @param $generatorName string Module name
583 * @return ApiQueryGeneratorBase
585 public function newGenerator( $generatorName ) {
586 $generator = $this->mModuleMgr
->getModule( $generatorName, null, true );
587 if ( $generator === null ) {
588 $this->dieUsage( "Unknown generator=$generatorName", 'badgenerator' );
590 if ( !$generator instanceof ApiQueryGeneratorBase
) {
591 $this->dieUsage( "Module $generatorName cannot be used as a generator", 'badgenerator' );
593 $generator->setGeneratorMode();
598 * For generator mode, execute generator, and use its output as new
600 * @param $generator ApiQueryGeneratorBase Generator Module
601 * @param $modules array of module objects
603 protected function executeGeneratorModule( $generator, $modules ) {
605 $resultPageSet = new ApiPageSet( $this, $this->redirects
, $this->convertTitles
);
607 // Add any additional fields modules may need
608 $generator->requestExtraData( $this->mPageSet
);
609 $this->addCustomFldsToPageSet( $modules, $resultPageSet );
611 // Populate page information with the original user input
612 $this->mPageSet
->execute();
614 // populate resultPageSet with the generator output
615 $generator->profileIn();
616 $generator->executeGenerator( $resultPageSet );
617 wfRunHooks( 'APIQueryGeneratorAfterExecute', array( &$generator, &$resultPageSet ) );
618 $resultPageSet->finishPageSetGeneration();
619 $generator->profileOut();
621 // Swap the resulting pageset back in
622 $this->mPageSet
= $resultPageSet;
625 public function getAllowedParams() {
628 ApiBase
::PARAM_ISMULTI
=> true,
629 ApiBase
::PARAM_TYPE
=> $this->mModuleMgr
->getNames( 'prop' )
632 ApiBase
::PARAM_ISMULTI
=> true,
633 ApiBase
::PARAM_TYPE
=> $this->mModuleMgr
->getNames( 'list' )
636 ApiBase
::PARAM_ISMULTI
=> true,
637 ApiBase
::PARAM_TYPE
=> $this->mModuleMgr
->getNames( 'meta' )
639 'generator' => array(
640 ApiBase
::PARAM_TYPE
=> $this->mAllowedGenerators
642 'redirects' => false,
643 'converttitles' => false,
644 'indexpageids' => false,
646 'exportnowrap' => false,
652 * Override the parent to generate help messages for all available query modules.
655 public function makeHelpMsg() {
656 // Make sure the internal object is empty
657 // (just in case a sub-module decides to optimize during instantiation)
658 $this->mPageSet
= null;
660 $querySeparator = str_repeat( '--- ', 12 );
661 $moduleSeparator = str_repeat( '*** ', 14 );
662 $msg = "\n$querySeparator Query: Prop $querySeparator\n\n";
663 $msg .= $this->makeHelpMsgHelper( 'prop' );
664 $msg .= "\n$querySeparator Query: List $querySeparator\n\n";
665 $msg .= $this->makeHelpMsgHelper( 'list' );
666 $msg .= "\n$querySeparator Query: Meta $querySeparator\n\n";
667 $msg .= $this->makeHelpMsgHelper( 'meta' );
668 $msg .= "\n\n$moduleSeparator Modules: continuation $moduleSeparator\n\n";
670 // Use parent to make default message for the query module
671 $msg = parent
::makeHelpMsg() . $msg;
677 * For all modules of a given group, generate help messages and join them together
678 * @param $group string Module group
681 private function makeHelpMsgHelper( $group ) {
682 $moduleDescriptions = array();
684 $moduleNames = $this->mModuleMgr
->getNames( $group );
685 sort( $moduleNames );
686 foreach ( $moduleNames as $name ) {
688 * @var $module ApiQueryBase
690 $module = $this->mModuleMgr
->getModule( $name );
692 $msg = ApiMain
::makeHelpMsgHeader( $module, $group );
693 $msg2 = $module->makeHelpMsg();
694 if ( $msg2 !== false ) {
697 if ( $module instanceof ApiQueryGeneratorBase
) {
698 $msg .= "Generator:\n This module may be used as a generator\n";
700 $moduleDescriptions[] = $msg;
703 return implode( "\n", $moduleDescriptions );
707 * Override to add extra parameters from PageSet
710 public function makeHelpMsgParameters() {
711 $psModule = new ApiPageSet( $this );
712 return $psModule->makeHelpMsgParameters() . parent
::makeHelpMsgParameters();
715 public function shouldCheckMaxlag() {
719 public function getParamDescription() {
721 'prop' => 'Which properties to get for the titles/revisions/pageids. Module help is available below',
722 'list' => 'Which lists to get. Module help is available below',
723 'meta' => 'Which metadata to get about the site. Module help is available below',
724 'generator' => array( 'Use the output of a list as the input for other prop/list/meta items',
725 'NOTE: generator parameter names must be prefixed with a \'g\', see examples' ),
726 'redirects' => 'Automatically resolve redirects',
727 'converttitles' => array( "Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion.",
728 'Languages that support variant conversion include ' . implode( ', ', LanguageConverter
::$languagesWithVariants ) ),
729 'indexpageids' => 'Include an additional pageids section listing all returned page IDs',
730 'export' => 'Export the current revisions of all given or generated pages',
731 'exportnowrap' => 'Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export',
732 'iwurl' => 'Whether to get the full URL if the title is an interwiki link',
736 public function getDescription() {
738 'Query API module allows applications to get needed pieces of data from the MediaWiki databases,',
739 'and is loosely based on the old query.php interface.',
740 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites'
744 public function getPossibleErrors() {
745 return array_merge( parent
::getPossibleErrors(), array(
746 array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ),
750 public function getExamples() {
752 'api.php?action=query&prop=revisions&meta=siteinfo&titles=Main%20Page&rvprop=user|comment',
753 'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions',
757 public function getHelpUrls() {
759 'https://www.mediawiki.org/wiki/API:Meta',
760 'https://www.mediawiki.org/wiki/API:Properties',
761 'https://www.mediawiki.org/wiki/API:Lists',