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 'allfileusages' => 'ApiQueryAllLinks',
68 'allimages' => 'ApiQueryAllImages',
69 'alllinks' => 'ApiQueryAllLinks',
70 'allpages' => 'ApiQueryAllPages',
71 'alltransclusions' => 'ApiQueryAllLinks',
72 'allusers' => 'ApiQueryAllUsers',
73 'backlinks' => 'ApiQueryBacklinks',
74 'blocks' => 'ApiQueryBlocks',
75 'categorymembers' => 'ApiQueryCategoryMembers',
76 'deletedrevs' => 'ApiQueryDeletedrevs',
77 'embeddedin' => 'ApiQueryBacklinks',
78 'exturlusage' => 'ApiQueryExtLinksUsage',
79 'filearchive' => 'ApiQueryFilearchive',
80 'imageusage' => 'ApiQueryBacklinks',
81 'iwbacklinks' => 'ApiQueryIWBacklinks',
82 'langbacklinks' => 'ApiQueryLangBacklinks',
83 'logevents' => 'ApiQueryLogEvents',
84 'pageswithprop' => 'ApiQueryPagesWithProp',
85 'pagepropnames' => 'ApiQueryPagePropNames',
86 'protectedtitles' => 'ApiQueryProtectedTitles',
87 'querypage' => 'ApiQueryQueryPage',
88 'random' => 'ApiQueryRandom',
89 'recentchanges' => 'ApiQueryRecentChanges',
90 'search' => 'ApiQuerySearch',
91 'tags' => 'ApiQueryTags',
92 'usercontribs' => 'ApiQueryContributions',
93 'users' => 'ApiQueryUsers',
94 'watchlist' => 'ApiQueryWatchlist',
95 'watchlistraw' => 'ApiQueryWatchlistRaw',
99 * List of Api Query meta modules
102 private static $QueryMetaModules = array(
103 'allmessages' => 'ApiQueryAllMessages',
104 'siteinfo' => 'ApiQuerySiteinfo',
105 'userinfo' => 'ApiQueryUserInfo',
106 'filerepoinfo' => 'ApiQueryFileRepoInfo',
115 private $mNamedDB = array();
117 private $mGeneratorContinue;
118 private $mUseLegacyContinue;
121 * @param $main ApiMain
122 * @param $action string
124 public function __construct( $main, $action ) {
125 parent
::__construct( $main, $action );
127 $this->mModuleMgr
= new ApiModuleManager( $this );
129 // Allow custom modules to be added in LocalSettings.php
130 global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules;
131 $this->mModuleMgr
->addModules( self
::$QueryPropModules, 'prop' );
132 $this->mModuleMgr
->addModules( $wgAPIPropModules, 'prop' );
133 $this->mModuleMgr
->addModules( self
::$QueryListModules, 'list' );
134 $this->mModuleMgr
->addModules( $wgAPIListModules, 'list' );
135 $this->mModuleMgr
->addModules( self
::$QueryMetaModules, 'meta' );
136 $this->mModuleMgr
->addModules( $wgAPIMetaModules, 'meta' );
138 // Create PageSet that will process titles/pageids/revids/generator
139 $this->mPageSet
= new ApiPageSet( $this );
143 * Overrides to return this instance's module manager.
144 * @return ApiModuleManager
146 public function getModuleManager() {
147 return $this->mModuleMgr
;
151 * Get the query database connection with the given name.
152 * If no such connection has been requested before, it will be created.
153 * Subsequent calls with the same $name will return the same connection
154 * as the first, regardless of the values of $db and $groups
155 * @param string $name Name to assign to the database connection
156 * @param int $db One of the DB_* constants
157 * @param array $groups Query groups
158 * @return DatabaseBase
160 public function getNamedDB( $name, $db, $groups ) {
161 if ( !array_key_exists( $name, $this->mNamedDB
) ) {
162 $this->profileDBIn();
163 $this->mNamedDB
[$name] = wfGetDB( $db, $groups );
164 $this->profileDBOut();
167 return $this->mNamedDB
[$name];
171 * Gets the set of pages the user has requested (or generated)
174 public function getPageSet() {
175 return $this->mPageSet
;
179 * Get the array mapping module names to class names
180 * @deprecated since 1.21, use getModuleManager()'s methods instead
181 * @return array array(modulename => classname)
183 public function getModules() {
184 wfDeprecated( __METHOD__
, '1.21' );
186 return $this->getModuleManager()->getNamesWithClasses();
190 * Get the generators array mapping module names to class names
191 * @deprecated since 1.21, list of generators is maintained by ApiPageSet
192 * @return array array(modulename => classname)
194 public function getGenerators() {
195 wfDeprecated( __METHOD__
, '1.21' );
197 foreach ( $this->mModuleMgr
->getNamesWithClasses() as $name => $class ) {
198 if ( is_subclass_of( $class, 'ApiQueryGeneratorBase' ) ) {
199 $gens[$name] = $class;
207 * Get whether the specified module is a prop, list or a meta query module
208 * @deprecated since 1.21, use getModuleManager()->getModuleGroup()
209 * @param string $moduleName Name of the module to find type for
210 * @return mixed string or null
212 function getModuleType( $moduleName ) {
213 return $this->getModuleManager()->getModuleGroup( $moduleName );
217 * @return ApiFormatRaw|null
219 public function getCustomPrinter() {
220 // If &exportnowrap is set, use the raw formatter
221 if ( $this->getParameter( 'export' ) &&
222 $this->getParameter( 'exportnowrap' )
224 return new ApiFormatRaw( $this->getMain(),
225 $this->getMain()->createPrinterByName( 'xml' ) );
232 * Query execution happens in the following steps:
233 * #1 Create a PageSet object with any pages requested by the user
234 * #2 If using a generator, execute it to get a new ApiPageSet object
235 * #3 Instantiate all requested modules.
236 * This way the PageSet object will know what shared data is required,
237 * and minimize DB calls.
238 * #4 Output all normalization and redirect resolution information
239 * #5 Execute all requested modules
241 public function execute() {
242 $this->mParams
= $this->extractRequestParams();
244 // $pagesetParams is a array of parameter names used by the pageset generator
245 // or null if pageset has already finished and is no longer needed
246 // $completeModules is a set of complete modules with the name as key
247 $this->initContinue( $pagesetParams, $completeModules );
249 // Instantiate requested modules
250 $allModules = array();
251 $this->instantiateModules( $allModules, 'prop' );
252 $propModules = $allModules; // Keep a copy
253 $this->instantiateModules( $allModules, 'list' );
254 $this->instantiateModules( $allModules, 'meta' );
256 // Filter modules based on continue parameter
257 $modules = $this->initModules( $allModules, $completeModules, $pagesetParams !== null );
259 // Execute pageset if in legacy mode or if pageset is not done
260 if ( $completeModules === null ||
$pagesetParams !== null ) {
261 // Populate page/revision information
262 $this->mPageSet
->execute();
263 // Record page information (title, namespace, if exists, etc)
264 $this->outputGeneralPageInfo();
266 $this->mPageSet
->executeDryRun();
269 $cacheMode = $this->mPageSet
->getCacheMode();
271 // Execute all unfinished modules
272 /** @var $module ApiQueryBase */
273 foreach ( $modules as $module ) {
274 $params = $module->extractRequestParams();
275 $cacheMode = $this->mergeCacheMode(
276 $cacheMode, $module->getCacheMode( $params ) );
277 $module->profileIn();
279 wfRunHooks( 'APIQueryAfterExecute', array( &$module ) );
280 $module->profileOut();
283 // Set the cache mode
284 $this->getMain()->setCacheMode( $cacheMode );
286 if ( $completeModules === null ) {
287 return; // Legacy continue, we are done
290 // Reformat query-continue result section
291 $result = $this->getResult();
292 $qc = $result->getData();
293 if ( isset( $qc['query-continue'] ) ) {
294 $qc = $qc['query-continue'];
295 $result->unsetValue( null, 'query-continue' );
296 } elseif ( $this->mGeneratorContinue
!== null ) {
299 // no more "continue"s, we are done!
303 // we are done with all the modules that do not have result in query-continue
304 $completeModules = array_merge( $completeModules, array_diff_key( $modules, $qc ) );
305 if ( $pagesetParams !== null ) {
306 // The pageset is still in use, check if all props have finished
307 $incompleteProps = array_intersect_key( $propModules, $qc );
308 if ( count( $incompleteProps ) > 0 ) {
309 // Properties are not done, continue with the same pageset state - copy current parameters
310 $main = $this->getMain();
311 $contValues = array();
312 foreach ( $pagesetParams as $param ) {
313 // The param name is already prefix-encoded
314 $contValues[$param] = $main->getVal( $param );
316 } elseif ( $this->mGeneratorContinue
!== null ) {
317 // Move to the next set of pages produced by pageset, properties need to be restarted
318 $contValues = $this->mGeneratorContinue
;
319 $pagesetParams = array_keys( $contValues );
320 $completeModules = array_diff_key( $completeModules, $propModules );
322 // Done with the pageset, finish up with the the lists and meta modules
323 $pagesetParams = null;
327 $continue = '||' . implode( '|', array_keys( $completeModules ) );
328 if ( $pagesetParams !== null ) {
329 // list of all pageset parameters to use in the next request
330 $continue = implode( '|', $pagesetParams ) . $continue;
332 // we are done with the pageset
333 $contValues = array();
334 $continue = '-' . $continue;
336 $contValues['continue'] = $continue;
337 foreach ( $qc as $qcModule ) {
338 foreach ( $qcModule as $qcKey => $qcValue ) {
339 $contValues[$qcKey] = $qcValue;
342 $this->getResult()->addValue( null, 'continue', $contValues );
346 * Parse 'continue' parameter into the list of complete modules and a list of generator parameters
347 * @param array|null $pagesetParams returns list of generator params or null if pageset is done
348 * @param array|null $completeModules returns list of finished modules (as keys), or null if legacy
350 private function initContinue( &$pagesetParams, &$completeModules ) {
351 $pagesetParams = array();
352 $continue = $this->mParams
['continue'];
353 if ( $continue !== null ) {
354 $this->mUseLegacyContinue
= false;
355 if ( $continue !== '' ) {
356 // Format: ' pagesetParam1 | pagesetParam2 || module1 | module2 | module3 | ...
357 // If pageset is done, use '-'
358 $continue = explode( '||', $continue );
359 $this->dieContinueUsageIf( count( $continue ) !== 2 );
360 if ( $continue[0] === '-' ) {
361 $pagesetParams = null; // No need to execute pageset
362 } elseif ( $continue[0] !== '' ) {
363 // list of pageset params that might need to be repeated
364 $pagesetParams = explode( '|', $continue[0] );
366 $continue = $continue[1];
368 if ( $continue !== '' ) {
369 $completeModules = array_flip( explode( '|', $continue ) );
371 $completeModules = array();
374 $this->mUseLegacyContinue
= true;
375 $completeModules = null;
380 * Validate sub-modules, filter out completed ones, and do requestExtraData()
381 * @param array $allModules An dict of name=>instance of all modules requested by the client
382 * @param array|null $completeModules list of finished modules, or null if legacy continue
383 * @param bool $usePageset True if pageset will be executed
384 * @return array of modules to be processed during this execution
386 private function initModules( $allModules, $completeModules, $usePageset ) {
387 $modules = $allModules;
388 $tmp = $completeModules;
389 $wasPosted = $this->getRequest()->wasPosted();
391 /** @var $module ApiQueryBase */
392 foreach ( $allModules as $moduleName => $module ) {
393 if ( !$wasPosted && $module->mustBePosted() ) {
394 $this->dieUsageMsgOrDebug( array( 'mustbeposted', $moduleName ) );
396 if ( $completeModules !== null && array_key_exists( $moduleName, $completeModules ) ) {
397 // If this module is done, mark all its params as used
398 $module->extractRequestParams();
399 // Make sure this module is not used during execution
400 unset( $modules[$moduleName] );
401 unset( $tmp[$moduleName] );
402 } elseif ( $completeModules === null ||
$usePageset ) {
403 // Query modules may optimize data requests through the $this->getPageSet()
404 // object by adding extra fields from the page table.
405 // This function will gather all the extra request fields from the modules.
406 $module->requestExtraData( $this->mPageSet
);
408 // Error - this prop module must have finished before generator is done
409 $this->dieContinueUsageIf( $this->mModuleMgr
->getModuleGroup( $moduleName ) === 'prop' );
412 $this->dieContinueUsageIf( $completeModules !== null && count( $tmp ) !== 0 );
418 * Update a cache mode string, applying the cache mode of a new module to it.
419 * The cache mode may increase in the level of privacy, but public modules
420 * added to private data do not decrease the level of privacy.
422 * @param $cacheMode string
423 * @param $modCacheMode string
426 protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
427 if ( $modCacheMode === 'anon-public-user-private' ) {
428 if ( $cacheMode !== 'private' ) {
429 $cacheMode = 'anon-public-user-private';
431 } elseif ( $modCacheMode === 'public' ) {
432 // do nothing, if it's public already it will stay public
434 $cacheMode = 'private';
441 * Create instances of all modules requested by the client
442 * @param array $modules to append instantiated modules to
443 * @param string $param Parameter name to read modules from
445 private function instantiateModules( &$modules, $param ) {
446 if ( isset( $this->mParams
[$param] ) ) {
447 foreach ( $this->mParams
[$param] as $moduleName ) {
448 $instance = $this->mModuleMgr
->getModule( $moduleName, $param );
449 if ( $instance === null ) {
450 ApiBase
::dieDebug( __METHOD__
, 'Error instantiating module' );
452 // Ignore duplicates. TODO 2.0: die()?
453 if ( !array_key_exists( $moduleName, $modules ) ) {
454 $modules[$moduleName] = $instance;
461 * Appends an element for each page in the current pageSet with the
462 * most general information (id, title), plus any title normalizations
463 * and missing or invalid title/pageids/revids.
465 private function outputGeneralPageInfo() {
466 $pageSet = $this->getPageSet();
467 $result = $this->getResult();
469 // We don't check for a full result set here because we can't be adding
470 // more than 380K. The maximum revision size is in the megabyte range,
471 // and the maximum result size must be even higher than that.
473 $values = $pageSet->getNormalizedTitlesAsResult( $result );
475 $result->addValue( 'query', 'normalized', $values );
477 $values = $pageSet->getConvertedTitlesAsResult( $result );
479 $result->addValue( 'query', 'converted', $values );
481 $values = $pageSet->getInterwikiTitlesAsResult( $result, $this->mParams
['iwurl'] );
483 $result->addValue( 'query', 'interwiki', $values );
485 $values = $pageSet->getRedirectTitlesAsResult( $result );
487 $result->addValue( 'query', 'redirects', $values );
489 $values = $pageSet->getMissingRevisionIDsAsResult( $result );
491 $result->addValue( 'query', 'badrevids', $values );
497 // Report any missing titles
498 foreach ( $pageSet->getMissingTitles() as $fakeId => $title ) {
500 ApiQueryBase
::addTitleInfo( $vals, $title );
501 $vals['missing'] = '';
502 $pages[$fakeId] = $vals;
504 // Report any invalid titles
505 foreach ( $pageSet->getInvalidTitles() as $fakeId => $title ) {
506 $pages[$fakeId] = array( 'title' => $title, 'invalid' => '' );
508 // Report any missing page ids
509 foreach ( $pageSet->getMissingPageIDs() as $pageid ) {
510 $pages[$pageid] = array(
515 // Report special pages
516 /** @var $title Title */
517 foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) {
519 ApiQueryBase
::addTitleInfo( $vals, $title );
520 $vals['special'] = '';
521 if ( $title->isSpecialPage() &&
522 !SpecialPageFactory
::exists( $title->getDBkey() )
524 $vals['missing'] = '';
525 } elseif ( $title->getNamespace() == NS_MEDIA
&&
526 !wfFindFile( $title )
528 $vals['missing'] = '';
530 $pages[$fakeId] = $vals;
533 // Output general page information for found titles
534 foreach ( $pageSet->getGoodTitles() as $pageid => $title ) {
536 $vals['pageid'] = $pageid;
537 ApiQueryBase
::addTitleInfo( $vals, $title );
538 $pages[$pageid] = $vals;
541 if ( count( $pages ) ) {
542 if ( $this->mParams
['indexpageids'] ) {
543 $pageIDs = array_keys( $pages );
544 // json treats all map keys as strings - converting to match
545 $pageIDs = array_map( 'strval', $pageIDs );
546 $result->setIndexedTagName( $pageIDs, 'id' );
547 $result->addValue( 'query', 'pageids', $pageIDs );
550 $result->setIndexedTagName( $pages, 'page' );
551 $result->addValue( 'query', 'pages', $pages );
553 if ( $this->mParams
['export'] ) {
554 $this->doExport( $pageSet, $result );
559 * This method is called by the generator base when generator in the smart-continue
560 * mode tries to set 'query-continue' value. ApiQuery stores those values separately
561 * until the post-processing when it is known if the generation should continue or repeat.
562 * @param ApiQueryGeneratorBase $module generator module
563 * @param string $paramName
564 * @param mixed $paramValue
565 * @return bool true if processed, false if this is a legacy continue
567 public function setGeneratorContinue( $module, $paramName, $paramValue ) {
568 if ( $this->mUseLegacyContinue
) {
571 $paramName = $module->encodeParamName( $paramName );
572 if ( $this->mGeneratorContinue
=== null ) {
573 $this->mGeneratorContinue
= array();
575 $this->mGeneratorContinue
[$paramName] = $paramValue;
581 * @param $pageSet ApiPageSet Pages to be exported
582 * @param $result ApiResult Result to output to
584 private function doExport( $pageSet, $result ) {
585 $exportTitles = array();
586 $titles = $pageSet->getGoodTitles();
587 if ( count( $titles ) ) {
588 $user = $this->getUser();
589 /** @var $title Title */
590 foreach ( $titles as $title ) {
591 if ( $title->userCan( 'read', $user ) ) {
592 $exportTitles[] = $title;
597 $exporter = new WikiExporter( $this->getDB() );
598 // WikiExporter writes to stdout, so catch its
601 $exporter->openStream();
602 foreach ( $exportTitles as $title ) {
603 $exporter->pageByTitle( $title );
605 $exporter->closeStream();
606 $exportxml = ob_get_contents();
609 // Don't check the size of exported stuff
610 // It's not continuable, so it would cause more
611 // problems than it'd solve
612 $result->disableSizeCheck();
613 if ( $this->mParams
['exportnowrap'] ) {
615 // Raw formatter will handle this
616 $result->addValue( null, 'text', $exportxml );
617 $result->addValue( null, 'mime', 'text/xml' );
620 ApiResult
::setContent( $r, $exportxml );
621 $result->addValue( 'query', 'export', $r );
623 $result->enableSizeCheck();
626 public function getAllowedParams( $flags = 0 ) {
629 ApiBase
::PARAM_ISMULTI
=> true,
630 ApiBase
::PARAM_TYPE
=> $this->mModuleMgr
->getNames( 'prop' )
633 ApiBase
::PARAM_ISMULTI
=> true,
634 ApiBase
::PARAM_TYPE
=> $this->mModuleMgr
->getNames( 'list' )
637 ApiBase
::PARAM_ISMULTI
=> true,
638 ApiBase
::PARAM_TYPE
=> $this->mModuleMgr
->getNames( 'meta' )
640 'indexpageids' => false,
642 'exportnowrap' => false,
647 $result +
= $this->getPageSet()->getFinalParams( $flags );
654 * Override the parent to generate help messages for all available query modules.
657 public function makeHelpMsg() {
659 // Use parent to make default message for the query module
660 $msg = parent
::makeHelpMsg();
662 $querySeparator = str_repeat( '--- ', 12 );
663 $moduleSeparator = str_repeat( '*** ', 14 );
664 $msg .= "\n$querySeparator Query: Prop $querySeparator\n\n";
665 $msg .= $this->makeHelpMsgHelper( 'prop' );
666 $msg .= "\n$querySeparator Query: List $querySeparator\n\n";
667 $msg .= $this->makeHelpMsgHelper( 'list' );
668 $msg .= "\n$querySeparator Query: Meta $querySeparator\n\n";
669 $msg .= $this->makeHelpMsgHelper( 'meta' );
670 $msg .= "\n\n$moduleSeparator Modules: continuation $moduleSeparator\n\n";
676 * For all modules of a given group, generate help messages and join them together
677 * @param string $group Module group
680 private function makeHelpMsgHelper( $group ) {
681 $moduleDescriptions = array();
683 $moduleNames = $this->mModuleMgr
->getNames( $group );
684 sort( $moduleNames );
685 foreach ( $moduleNames as $name ) {
687 * @var $module ApiQueryBase
689 $module = $this->mModuleMgr
->getModule( $name );
691 $msg = ApiMain
::makeHelpMsgHeader( $module, $group );
692 $msg2 = $module->makeHelpMsg();
693 if ( $msg2 !== false ) {
696 if ( $module instanceof ApiQueryGeneratorBase
) {
697 $msg .= "Generator:\n This module may be used as a generator\n";
699 $moduleDescriptions[] = $msg;
702 return implode( "\n", $moduleDescriptions );
705 public function shouldCheckMaxlag() {
709 public function getParamDescription() {
710 return $this->getPageSet()->getFinalParamDescription() +
array(
711 'prop' => 'Which properties to get for the titles/revisions/pageids. ' .
712 'Module help is available below',
713 'list' => 'Which lists to get. Module help is available below',
714 'meta' => 'Which metadata to get about the site. Module help is available below',
715 'indexpageids' => 'Include an additional pageids section listing all returned page IDs',
716 'export' => 'Export the current revisions of all given or generated pages',
717 'exportnowrap' => 'Return the export XML without wrapping it in an ' .
718 'XML result (same format as Special:Export). Can only be used with export',
719 'iwurl' => 'Whether to get the full URL if the title is an interwiki link',
721 'When present, formats query-continue as key-value pairs that ' .
722 'should simply be merged into the original request.',
723 'This parameter must be set to an empty string in the initial query.',
724 'This parameter is recommended for all new development, and ' .
725 'will be made default in the next API version.'
730 public function getDescription() {
732 'Query API module allows applications to get needed pieces of data ' .
733 'from the MediaWiki databases,',
734 'and is loosely based on the old query.php interface.',
735 'All data modifications will first have to use query to acquire a ' .
736 'token to prevent abuse from malicious sites'
740 public function getPossibleErrors() {
742 parent
::getPossibleErrors(),
743 $this->getPageSet()->getFinalPossibleErrors()
747 public function getExamples() {
749 'api.php?action=query&prop=revisions&meta=siteinfo&' .
750 'titles=Main%20Page&rvprop=user|comment&continue=',
751 'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions&continue=',
755 public function getHelpUrls() {
757 'https://www.mediawiki.org/wiki/API:Query',
758 'https://www.mediawiki.org/wiki/API:Meta',
759 'https://www.mediawiki.org/wiki/API:Properties',
760 'https://www.mediawiki.org/wiki/API:Lists',