64399b2f3a112631a3aa1149e60a6af49b9edb4c
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
{
40 private $mPropModuleNames, $mListModuleNames, $mMetaModuleNames;
47 private $params, $redirects, $convertTitles, $iwUrl;
49 private $mQueryPropModules = array(
50 'categories' => 'ApiQueryCategories',
51 'categoryinfo' => 'ApiQueryCategoryInfo',
52 'duplicatefiles' => 'ApiQueryDuplicateFiles',
53 'extlinks' => 'ApiQueryExternalLinks',
54 'images' => 'ApiQueryImages',
55 'imageinfo' => 'ApiQueryImageInfo',
56 'info' => 'ApiQueryInfo',
57 'links' => 'ApiQueryLinks',
58 'iwlinks' => 'ApiQueryIWLinks',
59 'langlinks' => 'ApiQueryLangLinks',
60 'pageprops' => 'ApiQueryPageProps',
61 'revisions' => 'ApiQueryRevisions',
62 'stashimageinfo' => 'ApiQueryStashImageInfo',
63 'templates' => 'ApiQueryLinks',
66 private $mQueryListModules = array(
67 'allcategories' => 'ApiQueryAllCategories',
68 'allimages' => 'ApiQueryAllImages',
69 'alllinks' => 'ApiQueryAllLinks',
70 'allpages' => 'ApiQueryAllPages',
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',
95 private $mQueryMetaModules = array(
96 'allmessages' => 'ApiQueryAllMessages',
97 'siteinfo' => 'ApiQuerySiteinfo',
98 'userinfo' => 'ApiQueryUserInfo',
101 private $mSlaveDB = null;
102 private $mNamedDB = array();
104 protected $mAllowedGenerators = array();
107 * @param $main ApiMain
108 * @param $action string
110 public function __construct( $main, $action ) {
111 parent
::__construct( $main, $action );
113 // Allow custom modules to be added in LocalSettings.php
114 global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules,
115 $wgMemc, $wgAPICacheHelpTimeout;
116 self
::appendUserModules( $this->mQueryPropModules
, $wgAPIPropModules );
117 self
::appendUserModules( $this->mQueryListModules
, $wgAPIListModules );
118 self
::appendUserModules( $this->mQueryMetaModules
, $wgAPIMetaModules );
120 $this->mPropModuleNames
= array_keys( $this->mQueryPropModules
);
121 $this->mListModuleNames
= array_keys( $this->mQueryListModules
);
122 $this->mMetaModuleNames
= array_keys( $this->mQueryMetaModules
);
124 // Get array of query generators from cache if present
125 $key = wfMemcKey( 'apiquerygenerators', SpecialVersion
::getVersion( 'nodb' ) );
127 if ( $wgAPICacheHelpTimeout > 0 ) {
128 $cached = $wgMemc->get( $key );
130 $this->mAllowedGenerators
= $cached;
134 $this->makeGeneratorList( $this->mQueryPropModules
);
135 $this->makeGeneratorList( $this->mQueryListModules
);
137 if ( $wgAPICacheHelpTimeout > 0 ) {
138 $wgMemc->set( $key, $this->mAllowedGenerators
, $wgAPICacheHelpTimeout );
143 * Helper function to append any add-in modules to the list
144 * @param $modules array Module array
145 * @param $newModules array Module array to add to $modules
147 private static function appendUserModules( &$modules, $newModules ) {
148 if ( is_array( $newModules ) ) {
149 foreach ( $newModules as $moduleName => $moduleClass ) {
150 $modules[$moduleName] = $moduleClass;
156 * Gets a default slave database connection object
157 * @return DatabaseBase
159 public function getDB() {
160 if ( !isset( $this->mSlaveDB
) ) {
161 $this->profileDBIn();
162 $this->mSlaveDB
= wfGetDB( DB_SLAVE
, 'api' );
163 $this->profileDBOut();
165 return $this->mSlaveDB
;
169 * Get the query database connection with the given name.
170 * If no such connection has been requested before, it will be created.
171 * Subsequent calls with the same $name will return the same connection
172 * as the first, regardless of the values of $db and $groups
173 * @param $name string Name to assign to the database connection
174 * @param $db int One of the DB_* constants
175 * @param $groups array Query groups
176 * @return DatabaseBase
178 public function getNamedDB( $name, $db, $groups ) {
179 if ( !array_key_exists( $name, $this->mNamedDB
) ) {
180 $this->profileDBIn();
181 $this->mNamedDB
[$name] = wfGetDB( $db, $groups );
182 $this->profileDBOut();
184 return $this->mNamedDB
[$name];
188 * Gets the set of pages the user has requested (or generated)
191 public function getPageSet() {
192 return $this->mPageSet
;
196 * Get the array mapping module names to class names
197 * @return array array(modulename => classname)
199 function getModules() {
200 return array_merge( $this->mQueryPropModules
, $this->mQueryListModules
, $this->mQueryMetaModules
);
204 * Get whether the specified module is a prop, list or a meta query module
205 * @param $moduleName string Name of the module to find type for
206 * @return mixed string or null
208 function getModuleType( $moduleName ) {
209 if ( isset( $this->mQueryPropModules
[$moduleName] ) ) {
213 if ( isset( $this->mQueryListModules
[$moduleName] ) ) {
217 if ( isset( $this->mQueryMetaModules
[$moduleName] ) ) {
225 * @return ApiFormatRaw|null
227 public function getCustomPrinter() {
228 // If &exportnowrap is set, use the raw formatter
229 if ( $this->getParameter( 'export' ) &&
230 $this->getParameter( 'exportnowrap' ) )
232 return new ApiFormatRaw( $this->getMain(),
233 $this->getMain()->createPrinterByName( 'xml' ) );
240 * Query execution happens in the following steps:
241 * #1 Create a PageSet object with any pages requested by the user
242 * #2 If using a generator, execute it to get a new ApiPageSet object
243 * #3 Instantiate all requested modules.
244 * This way the PageSet object will know what shared data is required,
245 * and minimize DB calls.
246 * #4 Output all normalization and redirect resolution information
247 * #5 Execute all requested modules
249 public function execute() {
250 $this->params
= $this->extractRequestParams();
251 $this->redirects
= $this->params
['redirects'];
252 $this->convertTitles
= $this->params
['converttitles'];
253 $this->iwUrl
= $this->params
['iwurl'];
256 $this->mPageSet
= new ApiPageSet( $this, $this->redirects
, $this->convertTitles
);
258 // Instantiate requested modules
260 $this->instantiateModules( $modules, 'prop', $this->mQueryPropModules
);
261 $this->instantiateModules( $modules, 'list', $this->mQueryListModules
);
262 $this->instantiateModules( $modules, 'meta', $this->mQueryMetaModules
);
264 $cacheMode = 'public';
266 // If given, execute generator to substitute user supplied data with generated data.
267 if ( isset( $this->params
['generator'] ) ) {
268 $generator = $this->newGenerator( $this->params
['generator'] );
269 $params = $generator->extractRequestParams();
270 $cacheMode = $this->mergeCacheMode( $cacheMode,
271 $generator->getCacheMode( $params ) );
272 $this->executeGeneratorModule( $generator, $modules );
274 // Append custom fields and populate page/revision information
275 $this->addCustomFldsToPageSet( $modules, $this->mPageSet
);
276 $this->mPageSet
->execute();
279 // Record page information (title, namespace, if exists, etc)
280 $this->outputGeneralPageInfo();
282 // Execute all requested modules.
284 * @var $module ApiQueryBase
286 foreach ( $modules as $module ) {
287 $params = $module->extractRequestParams();
288 $cacheMode = $this->mergeCacheMode(
289 $cacheMode, $module->getCacheMode( $params ) );
290 $module->profileIn();
292 wfRunHooks( 'APIQueryAfterExecute', array( &$module ) );
293 $module->profileOut();
296 // Set the cache mode
297 $this->getMain()->setCacheMode( $cacheMode );
301 * Update a cache mode string, applying the cache mode of a new module to it.
302 * The cache mode may increase in the level of privacy, but public modules
303 * added to private data do not decrease the level of privacy.
305 * @param $cacheMode string
306 * @param $modCacheMode string
309 protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
310 if ( $modCacheMode === 'anon-public-user-private' ) {
311 if ( $cacheMode !== 'private' ) {
312 $cacheMode = 'anon-public-user-private';
314 } elseif ( $modCacheMode === 'public' ) {
315 // do nothing, if it's public already it will stay public
317 $cacheMode = 'private';
323 * Query modules may optimize data requests through the $this->getPageSet() object
324 * by adding extra fields from the page table.
325 * This function will gather all the extra request fields from the modules.
326 * @param $modules array of module objects
327 * @param $pageSet ApiPageSet
329 private function addCustomFldsToPageSet( $modules, $pageSet ) {
330 // Query all requested modules.
332 * @var $module ApiQueryBase
334 foreach ( $modules as $module ) {
335 $module->requestExtraData( $pageSet );
340 * Create instances of all modules requested by the client
341 * @param $modules Array to append instantiated modules to
342 * @param $param string Parameter name to read modules from
343 * @param $moduleList Array array(modulename => classname)
345 private function instantiateModules( &$modules, $param, $moduleList ) {
346 if ( isset( $this->params
[$param] ) ) {
347 foreach ( $this->params
[$param] as $moduleName ) {
348 $modules[] = new $moduleList[$moduleName] ( $this, $moduleName );
354 * Appends an element for each page in the current pageSet with the
355 * most general information (id, title), plus any title normalizations
356 * and missing or invalid title/pageids/revids.
358 private function outputGeneralPageInfo() {
359 $pageSet = $this->getPageSet();
360 $result = $this->getResult();
362 // We don't check for a full result set here because we can't be adding
363 // more than 380K. The maximum revision size is in the megabyte range,
364 // and the maximum result size must be even higher than that.
366 // Title normalizations
367 $normValues = array();
368 foreach ( $pageSet->getNormalizedTitles() as $rawTitleStr => $titleStr ) {
369 $normValues[] = array(
370 'from' => $rawTitleStr,
375 if ( count( $normValues ) ) {
376 $result->setIndexedTagName( $normValues, 'n' );
377 $result->addValue( 'query', 'normalized', $normValues );
381 $convValues = array();
382 foreach ( $pageSet->getConvertedTitles() as $rawTitleStr => $titleStr ) {
383 $convValues[] = array(
384 'from' => $rawTitleStr,
389 if ( count( $convValues ) ) {
390 $result->setIndexedTagName( $convValues, 'c' );
391 $result->addValue( 'query', 'converted', $convValues );
395 $intrwValues = array();
396 foreach ( $pageSet->getInterwikiTitles() as $rawTitleStr => $interwikiStr ) {
398 'title' => $rawTitleStr,
399 'iw' => $interwikiStr,
401 if ( $this->iwUrl
) {
402 $title = Title
::newFromText( $rawTitleStr );
403 $item['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT
);
405 $intrwValues[] = $item;
408 if ( count( $intrwValues ) ) {
409 $result->setIndexedTagName( $intrwValues, 'i' );
410 $result->addValue( 'query', 'interwiki', $intrwValues );
413 // Show redirect information
414 $redirValues = array();
416 * @var $titleTo Title
418 foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleTo ) {
420 'from' => strval( $titleStrFrom ),
421 'to' => $titleTo->getPrefixedText(),
423 if ( $titleTo->getFragment() !== '' ) {
424 $r['tofragment'] = $titleTo->getFragment();
429 if ( count( $redirValues ) ) {
430 $result->setIndexedTagName( $redirValues, 'r' );
431 $result->addValue( 'query', 'redirects', $redirValues );
434 // Missing revision elements
435 $missingRevIDs = $pageSet->getMissingRevisionIDs();
436 if ( count( $missingRevIDs ) ) {
438 foreach ( $missingRevIDs as $revid ) {
439 $revids[$revid] = array(
443 $result->setIndexedTagName( $revids, 'rev' );
444 $result->addValue( 'query', 'badrevids', $revids );
450 // Report any missing titles
451 foreach ( $pageSet->getMissingTitles() as $fakeId => $title ) {
453 ApiQueryBase
::addTitleInfo( $vals, $title );
454 $vals['missing'] = '';
455 $pages[$fakeId] = $vals;
457 // Report any invalid titles
458 foreach ( $pageSet->getInvalidTitles() as $fakeId => $title ) {
459 $pages[$fakeId] = array( 'title' => $title, 'invalid' => '' );
461 // Report any missing page ids
462 foreach ( $pageSet->getMissingPageIDs() as $pageid ) {
463 $pages[$pageid] = array(
468 // Report special pages
469 foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) {
471 ApiQueryBase
::addTitleInfo( $vals, $title );
472 $vals['special'] = '';
473 if ( $title->isSpecialPage() &&
474 !SpecialPageFactory
::exists( $title->getDbKey() ) ) {
475 $vals['missing'] = '';
476 } elseif ( $title->getNamespace() == NS_MEDIA
&&
477 !wfFindFile( $title ) ) {
478 $vals['missing'] = '';
480 $pages[$fakeId] = $vals;
483 // Output general page information for found titles
484 foreach ( $pageSet->getGoodTitles() as $pageid => $title ) {
486 $vals['pageid'] = $pageid;
487 ApiQueryBase
::addTitleInfo( $vals, $title );
488 $pages[$pageid] = $vals;
491 if ( count( $pages ) ) {
492 if ( $this->params
['indexpageids'] ) {
493 $pageIDs = array_keys( $pages );
494 // json treats all map keys as strings - converting to match
495 $pageIDs = array_map( 'strval', $pageIDs );
496 $result->setIndexedTagName( $pageIDs, 'id' );
497 $result->addValue( 'query', 'pageids', $pageIDs );
500 $result->setIndexedTagName( $pages, 'page' );
501 $result->addValue( 'query', 'pages', $pages );
503 if ( $this->params
['export'] ) {
504 $this->doExport( $pageSet, $result );
509 * @param $pageSet ApiPageSet Pages to be exported
510 * @param $result ApiResult Result to output to
512 private function doExport( $pageSet, $result ) {
513 $exportTitles = array();
514 $titles = $pageSet->getGoodTitles();
515 if ( count( $titles ) ) {
516 $user = $this->getUser();
517 foreach ( $titles as $title ) {
518 if ( $title->userCan( 'read', $user ) ) {
519 $exportTitles[] = $title;
524 $exporter = new WikiExporter( $this->getDB() );
525 // WikiExporter writes to stdout, so catch its
528 $exporter->openStream();
529 foreach ( $exportTitles as $title ) {
530 $exporter->pageByTitle( $title );
532 $exporter->closeStream();
533 $exportxml = ob_get_contents();
536 // Don't check the size of exported stuff
537 // It's not continuable, so it would cause more
538 // problems than it'd solve
539 $result->disableSizeCheck();
540 if ( $this->params
['exportnowrap'] ) {
542 // Raw formatter will handle this
543 $result->addValue( null, 'text', $exportxml );
544 $result->addValue( null, 'mime', 'text/xml' );
547 ApiResult
::setContent( $r, $exportxml );
548 $result->addValue( 'query', 'export', $r );
550 $result->enableSizeCheck();
554 * Create a generator object of the given type and return it
555 * @param $generatorName string Module name
556 * @return ApiQueryGeneratorBase
558 public function newGenerator( $generatorName ) {
559 // Find class that implements requested generator
560 if ( isset( $this->mQueryListModules
[$generatorName] ) ) {
561 $className = $this->mQueryListModules
[$generatorName];
562 } elseif ( isset( $this->mQueryPropModules
[$generatorName] ) ) {
563 $className = $this->mQueryPropModules
[$generatorName];
565 ApiBase
::dieDebug( __METHOD__
, "Unknown generator=$generatorName" );
567 $generator = new $className ( $this, $generatorName );
568 if ( !$generator instanceof ApiQueryGeneratorBase
) {
569 $this->dieUsage( "Module $generatorName cannot be used as a generator", 'badgenerator' );
571 $generator->setGeneratorMode();
576 * For generator mode, execute generator, and use its output as new
578 * @param $generator ApiQueryGeneratorBase Generator Module
579 * @param $modules array of module objects
581 protected function executeGeneratorModule( $generator, $modules ) {
583 $resultPageSet = new ApiPageSet( $this, $this->redirects
, $this->convertTitles
);
585 // Add any additional fields modules may need
586 $generator->requestExtraData( $this->mPageSet
);
587 $this->addCustomFldsToPageSet( $modules, $resultPageSet );
589 // Populate page information with the original user input
590 $this->mPageSet
->execute();
592 // populate resultPageSet with the generator output
593 $generator->profileIn();
594 $generator->executeGenerator( $resultPageSet );
595 wfRunHooks( 'APIQueryGeneratorAfterExecute', array( &$generator, &$resultPageSet ) );
596 $resultPageSet->finishPageSetGeneration();
597 $generator->profileOut();
599 // Swap the resulting pageset back in
600 $this->mPageSet
= $resultPageSet;
603 public function getAllowedParams() {
606 ApiBase
::PARAM_ISMULTI
=> true,
607 ApiBase
::PARAM_TYPE
=> $this->mPropModuleNames
610 ApiBase
::PARAM_ISMULTI
=> true,
611 ApiBase
::PARAM_TYPE
=> $this->mListModuleNames
614 ApiBase
::PARAM_ISMULTI
=> true,
615 ApiBase
::PARAM_TYPE
=> $this->mMetaModuleNames
617 'generator' => array(
618 ApiBase
::PARAM_TYPE
=> $this->mAllowedGenerators
620 'redirects' => false,
621 'converttitles' => false,
622 'indexpageids' => false,
624 'exportnowrap' => false,
630 * Override the parent to generate help messages for all available query modules.
633 public function makeHelpMsg() {
634 // Make sure the internal object is empty
635 // (just in case a sub-module decides to optimize during instantiation)
636 $this->mPageSet
= null;
638 $querySeparator = str_repeat( '--- ', 12 );
639 $moduleSeparator = str_repeat( '*** ', 14 );
640 $msg = "\n$querySeparator Query: Prop $querySeparator\n\n";
641 $msg .= $this->makeHelpMsgHelper( $this->mQueryPropModules
, 'prop' );
642 $msg .= "\n$querySeparator Query: List $querySeparator\n\n";
643 $msg .= $this->makeHelpMsgHelper( $this->mQueryListModules
, 'list' );
644 $msg .= "\n$querySeparator Query: Meta $querySeparator\n\n";
645 $msg .= $this->makeHelpMsgHelper( $this->mQueryMetaModules
, 'meta' );
646 $msg .= "\n\n$moduleSeparator Modules: continuation $moduleSeparator\n\n";
648 // Use parent to make default message for the query module
649 $msg = parent
::makeHelpMsg() . $msg;
655 * For all modules in $moduleList, generate help messages and join them together
656 * @param $moduleList Array array(modulename => classname)
657 * @param $paramName string Parameter name
660 private function makeHelpMsgHelper( $moduleList, $paramName ) {
661 $moduleDescriptions = array();
663 foreach ( $moduleList as $moduleName => $moduleClass ) {
665 * @var $module ApiQueryBase
667 $module = new $moduleClass( $this, $moduleName, null );
669 $msg = ApiMain
::makeHelpMsgHeader( $module, $paramName );
670 $msg2 = $module->makeHelpMsg();
671 if ( $msg2 !== false ) {
674 if ( $module instanceof ApiQueryGeneratorBase
) {
675 $msg .= "Generator:\n This module may be used as a generator\n";
677 $moduleDescriptions[] = $msg;
680 return implode( "\n", $moduleDescriptions );
684 * Adds any classes that are a subclass of ApiQueryGeneratorBase
685 * to the allowed generator list
686 * @param $moduleList array()
688 private function makeGeneratorList( $moduleList ) {
689 foreach( $moduleList as $moduleName => $moduleClass ) {
690 if ( is_subclass_of( $moduleClass, 'ApiQueryGeneratorBase' ) ) {
691 $this->mAllowedGenerators
[] = $moduleName;
697 * Override to add extra parameters from PageSet
700 public function makeHelpMsgParameters() {
701 $psModule = new ApiPageSet( $this );
702 return $psModule->makeHelpMsgParameters() . parent
::makeHelpMsgParameters();
705 public function shouldCheckMaxlag() {
709 public function getParamDescription() {
711 'prop' => 'Which properties to get for the titles/revisions/pageids. Module help is available below',
712 'list' => 'Which lists to get. Module help is available below',
713 'meta' => 'Which metadata to get about the site. Module help is available below',
714 'generator' => array( 'Use the output of a list as the input for other prop/list/meta items',
715 'NOTE: generator parameter names must be prefixed with a \'g\', see examples' ),
716 'redirects' => 'Automatically resolve redirects',
717 'converttitles' => array( "Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion.",
718 'Languages that support variant conversion include ' . implode( ', ', LanguageConverter
::$languagesWithVariants ) ),
719 'indexpageids' => 'Include an additional pageids section listing all returned page IDs',
720 'export' => 'Export the current revisions of all given or generated pages',
721 'exportnowrap' => 'Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export',
722 'iwurl' => 'Whether to get the full URL if the title is an interwiki link',
726 public function getDescription() {
728 'Query API module allows applications to get needed pieces of data from the MediaWiki databases,',
729 'and is loosely based on the old query.php interface.',
730 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites'
734 public function getPossibleErrors() {
735 return array_merge( parent
::getPossibleErrors(), array(
736 array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ),
740 public function getExamples() {
742 'api.php?action=query&prop=revisions&meta=siteinfo&titles=Main%20Page&rvprop=user|comment',
743 'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions',
747 public function getHelpUrls() {
749 'https://www.mediawiki.org/wiki/API:Meta',
750 'https://www.mediawiki.org/wiki/API:Properties',
751 'https://www.mediawiki.org/wiki/API:Lists',
755 public function getVersion() {
756 $psModule = new ApiPageSet( $this );
758 $vers[] = __CLASS__
. ': $Id$';
759 $vers[] = $psModule->getVersion();