MediaWiki  master
ApiQuery.php
Go to the documentation of this file.
1 <?php
25 
37 class ApiQuery extends ApiBase {
38 
42  private const QUERY_PROP_MODULES = [
43  'categories' => ApiQueryCategories::class,
44  'categoryinfo' => ApiQueryCategoryInfo::class,
45  'contributors' => ApiQueryContributors::class,
46  'deletedrevisions' => ApiQueryDeletedRevisions::class,
47  'duplicatefiles' => ApiQueryDuplicateFiles::class,
48  'extlinks' => ApiQueryExternalLinks::class,
49  'fileusage' => ApiQueryBacklinksprop::class,
50  'images' => ApiQueryImages::class,
51  'imageinfo' => ApiQueryImageInfo::class,
52  'info' => [
53  'class' => ApiQueryInfo::class,
54  'services' => [
55  'ContentLanguage',
56  'LinkBatchFactory',
57  'NamespaceInfo',
58  'TitleFactory',
59  'WatchedItemStore',
60  ],
61  ],
62  'links' => ApiQueryLinks::class,
63  'linkshere' => ApiQueryBacklinksprop::class,
64  'iwlinks' => ApiQueryIWLinks::class,
65  'langlinks' => ApiQueryLangLinks::class,
66  'pageprops' => ApiQueryPageProps::class,
67  'redirects' => ApiQueryBacklinksprop::class,
68  'revisions' => ApiQueryRevisions::class,
69  'stashimageinfo' => ApiQueryStashImageInfo::class,
70  'templates' => ApiQueryLinks::class,
71  'transcludedin' => ApiQueryBacklinksprop::class,
72  ];
73 
77  private const QUERY_LIST_MODULES = [
78  'allcategories' => ApiQueryAllCategories::class,
79  'alldeletedrevisions' => ApiQueryAllDeletedRevisions::class,
80  'allfileusages' => ApiQueryAllLinks::class,
81  'allimages' => ApiQueryAllImages::class,
82  'alllinks' => ApiQueryAllLinks::class,
83  'allpages' => ApiQueryAllPages::class,
84  'allredirects' => ApiQueryAllLinks::class,
85  'allrevisions' => ApiQueryAllRevisions::class,
86  'mystashedfiles' => ApiQueryMyStashedFiles::class,
87  'alltransclusions' => ApiQueryAllLinks::class,
88  'allusers' => ApiQueryAllUsers::class,
89  'backlinks' => ApiQueryBacklinks::class,
90  'blocks' => ApiQueryBlocks::class,
91  'categorymembers' => ApiQueryCategoryMembers::class,
92  'deletedrevs' => ApiQueryDeletedrevs::class,
93  'embeddedin' => ApiQueryBacklinks::class,
94  'exturlusage' => ApiQueryExtLinksUsage::class,
95  'filearchive' => ApiQueryFilearchive::class,
96  'imageusage' => ApiQueryBacklinks::class,
97  'iwbacklinks' => ApiQueryIWBacklinks::class,
98  'langbacklinks' => ApiQueryLangBacklinks::class,
99  'logevents' => ApiQueryLogEvents::class,
100  'pageswithprop' => ApiQueryPagesWithProp::class,
101  'pagepropnames' => ApiQueryPagePropNames::class,
102  'prefixsearch' => ApiQueryPrefixSearch::class,
103  'protectedtitles' => ApiQueryProtectedTitles::class,
104  'querypage' => ApiQueryQueryPage::class,
105  'random' => ApiQueryRandom::class,
106  'recentchanges' => ApiQueryRecentChanges::class,
107  'search' => ApiQuerySearch::class,
108  'tags' => ApiQueryTags::class,
109  'usercontribs' => [
110  'class' => ApiQueryUserContribs::class,
111  'services' => [
112  'UserIdentityLookup',
113  ],
114  ],
115  'users' => ApiQueryUsers::class,
116  'watchlist' => ApiQueryWatchlist::class,
117  'watchlistraw' => ApiQueryWatchlistRaw::class,
118  ];
119 
123  private const QUERY_META_MODULES = [
124  'allmessages' => ApiQueryAllMessages::class,
125  'authmanagerinfo' => ApiQueryAuthManagerInfo::class,
126  'siteinfo' => ApiQuerySiteinfo::class,
127  'userinfo' => [
128  'class' => ApiQueryUserInfo::class,
129  'services' => [
130  'TalkPageNotificationManager',
131  'WatchedItemStore',
132  'UserEditTracker'
133  ]
134  ],
135  'filerepoinfo' => ApiQueryFileRepoInfo::class,
136  'tokens' => ApiQueryTokens::class,
137  'languageinfo' => [
138  'class' => ApiQueryLanguageinfo::class,
139  'services' => [
140  'LanguageFactory',
141  'LanguageNameUtils',
142  'LanguageFallback',
143  'LanguageConverterFactory',
144  ],
145  ],
146  ];
147 
151  private $mPageSet;
152 
153  private $mParams;
154  private $mNamedDB = [];
155  private $mModuleMgr;
156 
161  public function __construct( ApiMain $main, $action ) {
162  parent::__construct( $main, $action );
163 
164  $this->mModuleMgr = new ApiModuleManager(
165  $this,
166  MediaWikiServices::getInstance()->getObjectFactory()
167  );
168 
169  // Allow custom modules to be added in LocalSettings.php
170  $config = $this->getConfig();
171  $this->mModuleMgr->addModules( self::QUERY_PROP_MODULES, 'prop' );
172  $this->mModuleMgr->addModules( $config->get( 'APIPropModules' ), 'prop' );
173  $this->mModuleMgr->addModules( self::QUERY_LIST_MODULES, 'list' );
174  $this->mModuleMgr->addModules( $config->get( 'APIListModules' ), 'list' );
175  $this->mModuleMgr->addModules( self::QUERY_META_MODULES, 'meta' );
176  $this->mModuleMgr->addModules( $config->get( 'APIMetaModules' ), 'meta' );
177 
178  $this->getHookRunner()->onApiQuery__moduleManager( $this->mModuleMgr );
179 
180  // Create PageSet that will process titles/pageids/revids/generator
181  $this->mPageSet = new ApiPageSet( $this );
182  }
183 
188  public function getModuleManager() {
189  return $this->mModuleMgr;
190  }
191 
202  public function getNamedDB( $name, $db, $groups ) {
203  if ( !array_key_exists( $name, $this->mNamedDB ) ) {
204  $this->mNamedDB[$name] = wfGetDB( $db, $groups );
205  }
206 
207  return $this->mNamedDB[$name];
208  }
209 
214  public function getPageSet() {
215  return $this->mPageSet;
216  }
217 
221  public function getCustomPrinter() {
222  // If &exportnowrap is set, use the raw formatter
223  if ( $this->getParameter( 'export' ) &&
224  $this->getParameter( 'exportnowrap' )
225  ) {
226  return new ApiFormatRaw( $this->getMain(),
227  $this->getMain()->createPrinterByName( 'xml' ) );
228  } else {
229  return null;
230  }
231  }
232 
243  public function execute() {
244  $this->mParams = $this->extractRequestParams();
245 
246  // Instantiate requested modules
247  $allModules = [];
248  $this->instantiateModules( $allModules, 'prop' );
249  $propModules = array_keys( $allModules );
250  $this->instantiateModules( $allModules, 'list' );
251  $this->instantiateModules( $allModules, 'meta' );
252 
253  // Filter modules based on continue parameter
254  $continuationManager = new ApiContinuationManager( $this, $allModules, $propModules );
255  $this->setContinuationManager( $continuationManager );
257  $modules = $continuationManager->getRunModules();
258  '@phan-var ApiQueryBase[] $modules';
259 
260  if ( !$continuationManager->isGeneratorDone() ) {
261  // Query modules may optimize data requests through the $this->getPageSet()
262  // object by adding extra fields from the page table.
263  foreach ( $modules as $module ) {
264  $module->requestExtraData( $this->mPageSet );
265  }
266  // Populate page/revision information
267  $this->mPageSet->execute();
268  // Record page information (title, namespace, if exists, etc)
269  $this->outputGeneralPageInfo();
270  } else {
271  $this->mPageSet->executeDryRun();
272  }
273 
274  $cacheMode = $this->mPageSet->getCacheMode();
275 
276  // Execute all unfinished modules
277  foreach ( $modules as $module ) {
278  $params = $module->extractRequestParams();
279  $cacheMode = $this->mergeCacheMode(
280  $cacheMode, $module->getCacheMode( $params ) );
281  $module->execute();
282  $this->getHookRunner()->onAPIQueryAfterExecute( $module );
283  }
284 
285  // Set the cache mode
286  $this->getMain()->setCacheMode( $cacheMode );
287 
288  // Write the continuation data into the result
289  $this->setContinuationManager( null );
290  if ( $this->mParams['rawcontinue'] ) {
291  $data = $continuationManager->getRawNonContinuation();
292  if ( $data ) {
293  $this->getResult()->addValue( null, 'query-noncontinue', $data,
295  }
296  $data = $continuationManager->getRawContinuation();
297  if ( $data ) {
298  $this->getResult()->addValue( null, 'query-continue', $data,
300  }
301  } else {
302  $continuationManager->setContinuationIntoResult( $this->getResult() );
303  }
304  }
305 
315  protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
316  if ( $modCacheMode === 'anon-public-user-private' ) {
317  if ( $cacheMode !== 'private' ) {
318  $cacheMode = 'anon-public-user-private';
319  }
320  } elseif ( $modCacheMode === 'public' ) {
321  // do nothing, if it's public already it will stay public
322  } else {
323  $cacheMode = 'private';
324  }
325 
326  return $cacheMode;
327  }
328 
334  private function instantiateModules( &$modules, $param ) {
335  $wasPosted = $this->getRequest()->wasPosted();
336  if ( isset( $this->mParams[$param] ) ) {
337  foreach ( $this->mParams[$param] as $moduleName ) {
338  $instance = $this->mModuleMgr->getModule( $moduleName, $param );
339  if ( $instance === null ) {
340  ApiBase::dieDebug( __METHOD__, 'Error instantiating module' );
341  }
342  if ( !$wasPosted && $instance->mustBePosted() ) {
343  $this->dieWithErrorOrDebug( [ 'apierror-mustbeposted', $moduleName ] );
344  }
345  // Ignore duplicates. TODO 2.0: die()?
346  if ( !array_key_exists( $moduleName, $modules ) ) {
347  $modules[$moduleName] = $instance;
348  }
349  }
350  }
351  }
352 
358  private function outputGeneralPageInfo() {
359  $pageSet = $this->getPageSet();
360  $result = $this->getResult();
361 
362  // We can't really handle max-result-size failure here, but we need to
363  // check anyway in case someone set the limit stupidly low.
364  $fit = true;
365 
366  $values = $pageSet->getNormalizedTitlesAsResult( $result );
367  if ( $values ) {
368  // @phan-suppress-next-line PhanRedundantCondition
369  $fit = $fit && $result->addValue( 'query', 'normalized', $values );
370  }
371  $values = $pageSet->getConvertedTitlesAsResult( $result );
372  if ( $values ) {
373  $fit = $fit && $result->addValue( 'query', 'converted', $values );
374  }
375  $values = $pageSet->getInterwikiTitlesAsResult( $result, $this->mParams['iwurl'] );
376  if ( $values ) {
377  $fit = $fit && $result->addValue( 'query', 'interwiki', $values );
378  }
379  $values = $pageSet->getRedirectTitlesAsResult( $result );
380  if ( $values ) {
381  $fit = $fit && $result->addValue( 'query', 'redirects', $values );
382  }
383  $values = $pageSet->getMissingRevisionIDsAsResult( $result );
384  if ( $values ) {
385  $fit = $fit && $result->addValue( 'query', 'badrevids', $values );
386  }
387 
388  // Page elements
389  $pages = [];
390 
391  // Report any missing titles
392  foreach ( $pageSet->getMissingTitles() as $fakeId => $title ) {
393  $vals = [];
395  $vals['missing'] = true;
396  if ( $title->isKnown() ) {
397  $vals['known'] = true;
398  }
399  $pages[$fakeId] = $vals;
400  }
401  // Report any invalid titles
402  foreach ( $pageSet->getInvalidTitlesAndReasons() as $fakeId => $data ) {
403  $pages[$fakeId] = $data + [ 'invalid' => true ];
404  }
405  // Report any missing page ids
406  foreach ( $pageSet->getMissingPageIDs() as $pageid ) {
407  $pages[$pageid] = [
408  'pageid' => $pageid,
409  'missing' => true,
410  ];
411  }
412  // Report special pages
414  foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) {
415  $vals = [];
417  $vals['special'] = true;
418  if ( !$title->isKnown() ) {
419  $vals['missing'] = true;
420  }
421  $pages[$fakeId] = $vals;
422  }
423 
424  // Output general page information for found titles
425  foreach ( $pageSet->getGoodTitles() as $pageid => $title ) {
426  $vals = [];
427  $vals['pageid'] = $pageid;
429  $pages[$pageid] = $vals;
430  }
431 
432  if ( count( $pages ) ) {
433  $pageSet->populateGeneratorData( $pages );
434  ApiResult::setArrayType( $pages, 'BCarray' );
435 
436  if ( $this->mParams['indexpageids'] ) {
437  $pageIDs = array_keys( ApiResult::stripMetadataNonRecursive( $pages ) );
438  // json treats all map keys as strings - converting to match
439  $pageIDs = array_map( 'strval', $pageIDs );
440  ApiResult::setIndexedTagName( $pageIDs, 'id' );
441  $fit = $fit && $result->addValue( 'query', 'pageids', $pageIDs );
442  }
443 
444  ApiResult::setIndexedTagName( $pages, 'page' );
445  $fit = $fit && $result->addValue( 'query', 'pages', $pages );
446  }
447 
448  if ( !$fit ) {
449  $this->dieWithError( 'apierror-badconfig-resulttoosmall', 'badconfig' );
450  }
451 
452  if ( $this->mParams['export'] ) {
453  $this->doExport( $pageSet, $result );
454  }
455  }
456 
461  private function doExport( $pageSet, $result ) {
462  $exportTitles = [];
463  $titles = $pageSet->getGoodTitles();
464  if ( count( $titles ) ) {
466  foreach ( $titles as $title ) {
467  if ( $this->getAuthority()->authorizeRead( 'read', $title ) ) {
468  $exportTitles[] = $title;
469  }
470  }
471  }
472 
473  $exporter = new WikiExporter( $this->getDB() );
474  $sink = new DumpStringOutput;
475  $exporter->setOutputSink( $sink );
476  $exporter->setSchemaVersion( $this->mParams['exportschema'] );
477  $exporter->openStream();
478  foreach ( $exportTitles as $title ) {
479  $exporter->pageByTitle( $title );
480  }
481  $exporter->closeStream();
482 
483  // Don't check the size of exported stuff
484  // It's not continuable, so it would cause more
485  // problems than it'd solve
486  if ( $this->mParams['exportnowrap'] ) {
487  $result->reset();
488  // Raw formatter will handle this
489  $result->addValue( null, 'text', $sink, ApiResult::NO_SIZE_CHECK );
490  $result->addValue( null, 'mime', 'text/xml', ApiResult::NO_SIZE_CHECK );
491  $result->addValue( null, 'filename', 'export.xml', ApiResult::NO_SIZE_CHECK );
492  } else {
493  $result->addValue( 'query', 'export', $sink, ApiResult::NO_SIZE_CHECK );
494  $result->addValue( 'query', ApiResult::META_BC_SUBELEMENTS, [ 'export' ] );
495  }
496  }
497 
498  public function getAllowedParams( $flags = 0 ) {
499  $result = [
500  'prop' => [
501  ApiBase::PARAM_ISMULTI => true,
502  ApiBase::PARAM_TYPE => 'submodule',
503  ],
504  'list' => [
505  ApiBase::PARAM_ISMULTI => true,
506  ApiBase::PARAM_TYPE => 'submodule',
507  ],
508  'meta' => [
509  ApiBase::PARAM_ISMULTI => true,
510  ApiBase::PARAM_TYPE => 'submodule',
511  ],
512  'indexpageids' => false,
513  'export' => false,
514  'exportnowrap' => false,
515  'exportschema' => [
518  ],
519  'iwurl' => false,
520  'continue' => [
521  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
522  ],
523  'rawcontinue' => false,
524  ];
525  if ( $flags ) {
526  $result += $this->getPageSet()->getFinalParams( $flags );
527  }
528 
529  return $result;
530  }
531 
532  public function isReadMode() {
533  // We need to make an exception for certain meta modules that should be
534  // accessible even without the 'read' right. Restrict the exception as
535  // much as possible: no other modules allowed, and no pageset
536  // parameters either. We do allow the 'rawcontinue' and 'indexpageids'
537  // parameters since frameworks might add these unconditionally and they
538  // can't expose anything here.
539  $allowedParams = [ 'rawcontinue' => 1, 'indexpageids' => 1 ];
540  $this->mParams = $this->extractRequestParams();
541  $request = $this->getRequest();
542  foreach ( $this->mParams + $this->getPageSet()->extractRequestParams() as $param => $value ) {
543  $needed = $param === 'meta';
544  if ( !isset( $allowedParams[$param] ) && $request->getCheck( $param ) !== $needed ) {
545  return true;
546  }
547  }
548 
549  // Ask each module if it requires read mode. Any true => this returns
550  // true.
551  $modules = [];
552  $this->instantiateModules( $modules, 'meta' );
553  foreach ( $modules as $module ) {
554  if ( $module->isReadMode() ) {
555  return true;
556  }
557  }
558 
559  return false;
560  }
561 
562  protected function getExamplesMessages() {
563  return [
564  'action=query&prop=revisions&meta=siteinfo&' .
565  'titles=Main%20Page&rvprop=user|comment&continue='
566  => 'apihelp-query-example-revisions',
567  'action=query&generator=allpages&gapprefix=API/&prop=revisions&continue='
568  => 'apihelp-query-example-allpages',
569  ];
570  }
571 
572  public function getHelpUrls() {
573  return [
574  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Query',
575  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Meta',
576  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Properties',
577  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Lists',
578  ];
579  }
580 }
ApiMain
This is the main API class, used for both external and internal processing.
Definition: ApiMain.php:48
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:71
ApiQuery\isReadMode
isReadMode()
Indicates whether this module requires read rights Stable to override.
Definition: ApiQuery.php:532
WikiExporter\schemaVersion
static schemaVersion()
Returns the default export schema version, as defined by $wgXmlDumpSchemaVersion.
Definition: WikiExporter.php:92
ApiQuery\$mParams
$mParams
Definition: ApiQuery.php:153
ApiQuery
This is the main query class.
Definition: ApiQuery.php:37
ApiQuery\getPageSet
getPageSet()
Gets the set of pages the user has requested (or generated)
Definition: ApiQuery.php:214
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:172
ApiContinuationManager
This manages continuation state.
Definition: ApiContinuationManager.php:26
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1384
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:105
true
return true
Definition: router.php:90
ApiResult\META_BC_SUBELEMENTS
const META_BC_SUBELEMENTS
Key for the 'BC subelements' metadata item.
Definition: ApiResult.php:143
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:72
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:561
ApiBase\dieWithErrorOrDebug
dieWithErrorOrDebug( $msg, $code=null, $data=null, $httpCode=null)
Will only set a warning instead of failing if the global $wgDebugAPI is set to true.
Definition: ApiBase.php:1549
ApiBase\setContinuationManager
setContinuationManager(ApiContinuationManager $manager=null)
Definition: ApiBase.php:614
ApiQuery\QUERY_LIST_MODULES
const QUERY_LIST_MODULES
List of Api Query list modules.
Definition: ApiQuery.php:77
ApiBase\getDB
getDB()
Gets a default replica DB connection object Stable to override.
Definition: ApiBase.php:590
ApiResult\NO_SIZE_CHECK
const NO_SIZE_CHECK
For addValue() and similar functions, do not check size while adding a value Don't use this unless yo...
Definition: ApiResult.php:58
ContextSource\getRequest
getRequest()
Definition: ContextSource.php:80
XmlDumpWriter\$supportedSchemas
static string[] $supportedSchemas
the schema versions supported for output @final
Definition: XmlDumpWriter.php:57
ApiQuery\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQuery.php:572
ApiPageSet
This class contains a list of pages that the client has requested.
Definition: ApiPageSet.php:42
ApiBase
This abstract class implements many basic API functions, and is the base of all API classes.
Definition: ApiBase.php:55
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
ApiQuery\QUERY_META_MODULES
const QUERY_META_MODULES
List of Api Query meta modules.
Definition: ApiQuery.php:123
ApiQuery\__construct
__construct(ApiMain $main, $action)
Definition: ApiQuery.php:161
ApiResult\setArrayType
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
Definition: ApiResult.php:719
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2467
$modules
$modules
Definition: HTMLFormElement.php:15
ApiFormatRaw
Formatter that spits out anything you like with any desired MIME type.
Definition: ApiFormatRaw.php:27
ApiQuery\getNamedDB
getNamedDB( $name, $db, $groups)
Get the query database connection with the given name.
Definition: ApiQuery.php:202
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:720
ApiResult\stripMetadataNonRecursive
static stripMetadataNonRecursive( $data, &$metadata=null)
Remove metadata keys from a data array or object, non-recursive.
Definition: ApiResult.php:1049
$title
$title
Definition: testCompression.php:38
WikiExporter
Definition: WikiExporter.php:40
ApiModuleManager
This class holds a list of modules and handles instantiation.
Definition: ApiModuleManager.php:33
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:607
ContextSource\getAuthority
getAuthority()
Definition: ContextSource.php:142
ApiQuery\doExport
doExport( $pageSet, $result)
Definition: ApiQuery.php:461
ApiQuery\getModuleManager
getModuleManager()
Overrides to return this instance's module manager.
Definition: ApiQuery.php:188
Title
Represents a title within MediaWiki.
Definition: Title.php:46
ApiQuery\getCustomPrinter
getCustomPrinter()
Definition: ApiQuery.php:221
ApiResult\ADD_ON_TOP
const ADD_ON_TOP
For addValue(), setValue() and similar functions, if the value does not exist, add it as the first el...
Definition: ApiResult.php:49
ApiQuery\QUERY_PROP_MODULES
const QUERY_PROP_MODULES
List of Api Query prop modules.
Definition: ApiQuery.php:42
ApiQuery\mergeCacheMode
mergeCacheMode( $cacheMode, $modCacheMode)
Update a cache mode string, applying the cache mode of a new module to it.
Definition: ApiQuery.php:315
ApiQuery\$mPageSet
ApiPageSet $mPageSet
Definition: ApiQuery.php:151
ApiBase\PARAM_DFLT
const PARAM_DFLT
Definition: ApiBase.php:70
ApiQuery\outputGeneralPageInfo
outputGeneralPageInfo()
Appends an element for each page in the current pageSet with the most general information (id,...
Definition: ApiQuery.php:358
ApiQuery\getAllowedParams
getAllowedParams( $flags=0)
Definition: ApiQuery.php:498
ApiBase\getParameter
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:840
ApiQuery\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQuery.php:562
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
Definition: ApiBase.php:71
ApiQuery\$mModuleMgr
$mModuleMgr
Definition: ApiQuery.php:155
ApiBase\getMain
getMain()
Get the main module.
Definition: ApiBase.php:456
ApiBase\getHookRunner
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition: ApiBase.php:666
ApiQuery\execute
execute()
Query execution happens in the following steps: #1 Create a PageSet object with any pages requested b...
Definition: ApiQuery.php:243
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1579
ApiQuery\$mNamedDB
$mNamedDB
Definition: ApiQuery.php:154
DumpStringOutput
Definition: DumpStringOutput.php:27
ApiQuery\instantiateModules
instantiateModules(&$modules, $param)
Create instances of all modules requested by the client.
Definition: ApiQuery.php:334
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:466