MediaWiki  master
ApiQuery.php
Go to the documentation of this file.
1 <?php
25 
37 class ApiQuery extends ApiBase {
38 
43  private static $QueryPropModules = [
44  'categories' => ApiQueryCategories::class,
45  'categoryinfo' => ApiQueryCategoryInfo::class,
46  'contributors' => ApiQueryContributors::class,
47  'deletedrevisions' => ApiQueryDeletedRevisions::class,
48  'duplicatefiles' => ApiQueryDuplicateFiles::class,
49  'extlinks' => ApiQueryExternalLinks::class,
50  'fileusage' => ApiQueryBacklinksprop::class,
51  'images' => ApiQueryImages::class,
52  'imageinfo' => ApiQueryImageInfo::class,
53  'info' => ApiQueryInfo::class,
54  'links' => ApiQueryLinks::class,
55  'linkshere' => ApiQueryBacklinksprop::class,
56  'iwlinks' => ApiQueryIWLinks::class,
57  'langlinks' => ApiQueryLangLinks::class,
58  'pageprops' => ApiQueryPageProps::class,
59  'redirects' => ApiQueryBacklinksprop::class,
60  'revisions' => ApiQueryRevisions::class,
61  'stashimageinfo' => ApiQueryStashImageInfo::class,
62  'templates' => ApiQueryLinks::class,
63  'transcludedin' => ApiQueryBacklinksprop::class,
64  ];
65 
70  private static $QueryListModules = [
71  'allcategories' => ApiQueryAllCategories::class,
72  'alldeletedrevisions' => ApiQueryAllDeletedRevisions::class,
73  'allfileusages' => ApiQueryAllLinks::class,
74  'allimages' => ApiQueryAllImages::class,
75  'alllinks' => ApiQueryAllLinks::class,
76  'allpages' => ApiQueryAllPages::class,
77  'allredirects' => ApiQueryAllLinks::class,
78  'allrevisions' => ApiQueryAllRevisions::class,
79  'mystashedfiles' => ApiQueryMyStashedFiles::class,
80  'alltransclusions' => ApiQueryAllLinks::class,
81  'allusers' => ApiQueryAllUsers::class,
82  'backlinks' => ApiQueryBacklinks::class,
83  'blocks' => ApiQueryBlocks::class,
84  'categorymembers' => ApiQueryCategoryMembers::class,
85  'deletedrevs' => ApiQueryDeletedrevs::class,
86  'embeddedin' => ApiQueryBacklinks::class,
87  'exturlusage' => ApiQueryExtLinksUsage::class,
88  'filearchive' => ApiQueryFilearchive::class,
89  'imageusage' => ApiQueryBacklinks::class,
90  'iwbacklinks' => ApiQueryIWBacklinks::class,
91  'langbacklinks' => ApiQueryLangBacklinks::class,
92  'logevents' => ApiQueryLogEvents::class,
93  'pageswithprop' => ApiQueryPagesWithProp::class,
94  'pagepropnames' => ApiQueryPagePropNames::class,
95  'prefixsearch' => ApiQueryPrefixSearch::class,
96  'protectedtitles' => ApiQueryProtectedTitles::class,
97  'querypage' => ApiQueryQueryPage::class,
98  'random' => ApiQueryRandom::class,
99  'recentchanges' => ApiQueryRecentChanges::class,
100  'search' => ApiQuerySearch::class,
101  'tags' => ApiQueryTags::class,
102  'usercontribs' => ApiQueryUserContribs::class,
103  'users' => ApiQueryUsers::class,
104  'watchlist' => ApiQueryWatchlist::class,
105  'watchlistraw' => ApiQueryWatchlistRaw::class,
106  ];
107 
112  private static $QueryMetaModules = [
113  'allmessages' => ApiQueryAllMessages::class,
114  'authmanagerinfo' => ApiQueryAuthManagerInfo::class,
115  'siteinfo' => ApiQuerySiteinfo::class,
116  'userinfo' => ApiQueryUserInfo::class,
117  'filerepoinfo' => ApiQueryFileRepoInfo::class,
118  'tokens' => ApiQueryTokens::class,
119  'languageinfo' => [
120  'class' => ApiQueryLanguageinfo::class,
121  'services' => [
122  'LanguageFactory',
123  'LanguageNameUtils',
124  'LanguageFallback',
125  'LanguageConverterFactory',
126  ],
127  ],
128  ];
129 
133  private $mPageSet;
134 
135  private $mParams;
136  private $mNamedDB = [];
137  private $mModuleMgr;
138 
143  public function __construct( ApiMain $main, $action ) {
144  parent::__construct( $main, $action );
145 
146  $this->mModuleMgr = new ApiModuleManager(
147  $this,
148  MediaWikiServices::getInstance()->getObjectFactory()
149  );
150 
151  // Allow custom modules to be added in LocalSettings.php
152  $config = $this->getConfig();
153  $this->mModuleMgr->addModules( self::$QueryPropModules, 'prop' );
154  $this->mModuleMgr->addModules( $config->get( 'APIPropModules' ), 'prop' );
155  $this->mModuleMgr->addModules( self::$QueryListModules, 'list' );
156  $this->mModuleMgr->addModules( $config->get( 'APIListModules' ), 'list' );
157  $this->mModuleMgr->addModules( self::$QueryMetaModules, 'meta' );
158  $this->mModuleMgr->addModules( $config->get( 'APIMetaModules' ), 'meta' );
159 
160  $this->getHookRunner()->onApiQuery__moduleManager( $this->mModuleMgr );
161 
162  // Create PageSet that will process titles/pageids/revids/generator
163  $this->mPageSet = new ApiPageSet( $this );
164  }
165 
170  public function getModuleManager() {
171  return $this->mModuleMgr;
172  }
173 
184  public function getNamedDB( $name, $db, $groups ) {
185  if ( !array_key_exists( $name, $this->mNamedDB ) ) {
186  $this->mNamedDB[$name] = wfGetDB( $db, $groups );
187  }
188 
189  return $this->mNamedDB[$name];
190  }
191 
196  public function getPageSet() {
197  return $this->mPageSet;
198  }
199 
203  public function getCustomPrinter() {
204  // If &exportnowrap is set, use the raw formatter
205  if ( $this->getParameter( 'export' ) &&
206  $this->getParameter( 'exportnowrap' )
207  ) {
208  return new ApiFormatRaw( $this->getMain(),
209  $this->getMain()->createPrinterByName( 'xml' ) );
210  } else {
211  return null;
212  }
213  }
214 
225  public function execute() {
226  $this->mParams = $this->extractRequestParams();
227 
228  // Instantiate requested modules
229  $allModules = [];
230  $this->instantiateModules( $allModules, 'prop' );
231  $propModules = array_keys( $allModules );
232  $this->instantiateModules( $allModules, 'list' );
233  $this->instantiateModules( $allModules, 'meta' );
234 
235  // Filter modules based on continue parameter
236  $continuationManager = new ApiContinuationManager( $this, $allModules, $propModules );
237  $this->setContinuationManager( $continuationManager );
239  $modules = $continuationManager->getRunModules();
240  '@phan-var ApiQueryBase[] $modules';
241 
242  if ( !$continuationManager->isGeneratorDone() ) {
243  // Query modules may optimize data requests through the $this->getPageSet()
244  // object by adding extra fields from the page table.
245  foreach ( $modules as $module ) {
246  $module->requestExtraData( $this->mPageSet );
247  }
248  // Populate page/revision information
249  $this->mPageSet->execute();
250  // Record page information (title, namespace, if exists, etc)
251  $this->outputGeneralPageInfo();
252  } else {
253  $this->mPageSet->executeDryRun();
254  }
255 
256  $cacheMode = $this->mPageSet->getCacheMode();
257 
258  // Execute all unfinished modules
259  foreach ( $modules as $module ) {
260  $params = $module->extractRequestParams();
261  $cacheMode = $this->mergeCacheMode(
262  $cacheMode, $module->getCacheMode( $params ) );
263  $module->execute();
264  $this->getHookRunner()->onAPIQueryAfterExecute( $module );
265  }
266 
267  // Set the cache mode
268  $this->getMain()->setCacheMode( $cacheMode );
269 
270  // Write the continuation data into the result
271  $this->setContinuationManager( null );
272  if ( $this->mParams['rawcontinue'] ) {
273  $data = $continuationManager->getRawNonContinuation();
274  if ( $data ) {
275  $this->getResult()->addValue( null, 'query-noncontinue', $data,
277  }
278  $data = $continuationManager->getRawContinuation();
279  if ( $data ) {
280  $this->getResult()->addValue( null, 'query-continue', $data,
282  }
283  } else {
284  $continuationManager->setContinuationIntoResult( $this->getResult() );
285  }
286  }
287 
297  protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
298  if ( $modCacheMode === 'anon-public-user-private' ) {
299  if ( $cacheMode !== 'private' ) {
300  $cacheMode = 'anon-public-user-private';
301  }
302  } elseif ( $modCacheMode === 'public' ) {
303  // do nothing, if it's public already it will stay public
304  } else {
305  $cacheMode = 'private';
306  }
307 
308  return $cacheMode;
309  }
310 
316  private function instantiateModules( &$modules, $param ) {
317  $wasPosted = $this->getRequest()->wasPosted();
318  if ( isset( $this->mParams[$param] ) ) {
319  foreach ( $this->mParams[$param] as $moduleName ) {
320  $instance = $this->mModuleMgr->getModule( $moduleName, $param );
321  if ( $instance === null ) {
322  ApiBase::dieDebug( __METHOD__, 'Error instantiating module' );
323  }
324  if ( !$wasPosted && $instance->mustBePosted() ) {
325  $this->dieWithErrorOrDebug( [ 'apierror-mustbeposted', $moduleName ] );
326  }
327  // Ignore duplicates. TODO 2.0: die()?
328  if ( !array_key_exists( $moduleName, $modules ) ) {
329  $modules[$moduleName] = $instance;
330  }
331  }
332  }
333  }
334 
340  private function outputGeneralPageInfo() {
341  $pageSet = $this->getPageSet();
342  $result = $this->getResult();
343 
344  // We can't really handle max-result-size failure here, but we need to
345  // check anyway in case someone set the limit stupidly low.
346  $fit = true;
347 
348  $values = $pageSet->getNormalizedTitlesAsResult( $result );
349  if ( $values ) {
350  $fit = $fit && $result->addValue( 'query', 'normalized', $values );
351  }
352  $values = $pageSet->getConvertedTitlesAsResult( $result );
353  if ( $values ) {
354  $fit = $fit && $result->addValue( 'query', 'converted', $values );
355  }
356  $values = $pageSet->getInterwikiTitlesAsResult( $result, $this->mParams['iwurl'] );
357  if ( $values ) {
358  $fit = $fit && $result->addValue( 'query', 'interwiki', $values );
359  }
360  $values = $pageSet->getRedirectTitlesAsResult( $result );
361  if ( $values ) {
362  $fit = $fit && $result->addValue( 'query', 'redirects', $values );
363  }
364  $values = $pageSet->getMissingRevisionIDsAsResult( $result );
365  if ( $values ) {
366  $fit = $fit && $result->addValue( 'query', 'badrevids', $values );
367  }
368 
369  // Page elements
370  $pages = [];
371 
372  // Report any missing titles
373  foreach ( $pageSet->getMissingTitles() as $fakeId => $title ) {
374  $vals = [];
376  $vals['missing'] = true;
377  if ( $title->isKnown() ) {
378  $vals['known'] = true;
379  }
380  $pages[$fakeId] = $vals;
381  }
382  // Report any invalid titles
383  foreach ( $pageSet->getInvalidTitlesAndReasons() as $fakeId => $data ) {
384  $pages[$fakeId] = $data + [ 'invalid' => true ];
385  }
386  // Report any missing page ids
387  foreach ( $pageSet->getMissingPageIDs() as $pageid ) {
388  $pages[$pageid] = [
389  'pageid' => $pageid,
390  'missing' => true,
391  ];
392  }
393  // Report special pages
395  foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) {
396  $vals = [];
398  $vals['special'] = true;
399  if ( !$title->isKnown() ) {
400  $vals['missing'] = true;
401  }
402  $pages[$fakeId] = $vals;
403  }
404 
405  // Output general page information for found titles
406  foreach ( $pageSet->getGoodTitles() as $pageid => $title ) {
407  $vals = [];
408  $vals['pageid'] = $pageid;
410  $pages[$pageid] = $vals;
411  }
412 
413  if ( count( $pages ) ) {
414  $pageSet->populateGeneratorData( $pages );
415  ApiResult::setArrayType( $pages, 'BCarray' );
416 
417  if ( $this->mParams['indexpageids'] ) {
418  $pageIDs = array_keys( ApiResult::stripMetadataNonRecursive( $pages ) );
419  // json treats all map keys as strings - converting to match
420  $pageIDs = array_map( 'strval', $pageIDs );
421  ApiResult::setIndexedTagName( $pageIDs, 'id' );
422  $fit = $fit && $result->addValue( 'query', 'pageids', $pageIDs );
423  }
424 
425  ApiResult::setIndexedTagName( $pages, 'page' );
426  $fit = $fit && $result->addValue( 'query', 'pages', $pages );
427  }
428 
429  if ( !$fit ) {
430  $this->dieWithError( 'apierror-badconfig-resulttoosmall', 'badconfig' );
431  }
432 
433  if ( $this->mParams['export'] ) {
434  $this->doExport( $pageSet, $result );
435  }
436  }
437 
442  private function doExport( $pageSet, $result ) {
443  $exportTitles = [];
444  $titles = $pageSet->getGoodTitles();
445  if ( count( $titles ) ) {
447  foreach ( $titles as $title ) {
448  if ( $this->getPermissionManager()->userCan( 'read', $this->getUser(), $title ) ) {
449  $exportTitles[] = $title;
450  }
451  }
452  }
453 
454  $exporter = new WikiExporter( $this->getDB() );
455  $sink = new DumpStringOutput;
456  $exporter->setOutputSink( $sink );
457  $exporter->setSchemaVersion( $this->mParams['exportschema'] );
458  $exporter->openStream();
459  foreach ( $exportTitles as $title ) {
460  $exporter->pageByTitle( $title );
461  }
462  $exporter->closeStream();
463 
464  // Don't check the size of exported stuff
465  // It's not continuable, so it would cause more
466  // problems than it'd solve
467  if ( $this->mParams['exportnowrap'] ) {
468  $result->reset();
469  // Raw formatter will handle this
470  $result->addValue( null, 'text', $sink, ApiResult::NO_SIZE_CHECK );
471  $result->addValue( null, 'mime', 'text/xml', ApiResult::NO_SIZE_CHECK );
472  $result->addValue( null, 'filename', 'export.xml', ApiResult::NO_SIZE_CHECK );
473  } else {
474  $result->addValue( 'query', 'export', $sink, ApiResult::NO_SIZE_CHECK );
475  $result->addValue( 'query', ApiResult::META_BC_SUBELEMENTS, [ 'export' ] );
476  }
477  }
478 
479  public function getAllowedParams( $flags = 0 ) {
480  $result = [
481  'prop' => [
482  ApiBase::PARAM_ISMULTI => true,
483  ApiBase::PARAM_TYPE => 'submodule',
484  ],
485  'list' => [
486  ApiBase::PARAM_ISMULTI => true,
487  ApiBase::PARAM_TYPE => 'submodule',
488  ],
489  'meta' => [
490  ApiBase::PARAM_ISMULTI => true,
491  ApiBase::PARAM_TYPE => 'submodule',
492  ],
493  'indexpageids' => false,
494  'export' => false,
495  'exportnowrap' => false,
496  'exportschema' => [
499  ],
500  'iwurl' => false,
501  'continue' => [
502  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
503  ],
504  'rawcontinue' => false,
505  ];
506  if ( $flags ) {
507  $result += $this->getPageSet()->getFinalParams( $flags );
508  }
509 
510  return $result;
511  }
512 
513  public function isReadMode() {
514  // We need to make an exception for certain meta modules that should be
515  // accessible even without the 'read' right. Restrict the exception as
516  // much as possible: no other modules allowed, and no pageset
517  // parameters either. We do allow the 'rawcontinue' and 'indexpageids'
518  // parameters since frameworks might add these unconditionally and they
519  // can't expose anything here.
520  $allowedParams = [ 'rawcontinue' => 1, 'indexpageids' => 1 ];
521  $this->mParams = $this->extractRequestParams();
522  $request = $this->getRequest();
523  foreach ( $this->mParams + $this->getPageSet()->extractRequestParams() as $param => $value ) {
524  $needed = $param === 'meta';
525  if ( !isset( $allowedParams[$param] ) && $request->getCheck( $param ) !== $needed ) {
526  return true;
527  }
528  }
529 
530  // Ask each module if it requires read mode. Any true => this returns
531  // true.
532  $modules = [];
533  $this->instantiateModules( $modules, 'meta' );
534  foreach ( $modules as $module ) {
535  if ( $module->isReadMode() ) {
536  return true;
537  }
538  }
539 
540  return false;
541  }
542 
543  protected function getExamplesMessages() {
544  return [
545  'action=query&prop=revisions&meta=siteinfo&' .
546  'titles=Main%20Page&rvprop=user|comment&continue='
547  => 'apihelp-query-example-revisions',
548  'action=query&generator=allpages&gapprefix=API/&prop=revisions&continue='
549  => 'apihelp-query-example-allpages',
550  ];
551  }
552 
553  public function getHelpUrls() {
554  return [
555  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Query',
556  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Meta',
557  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Properties',
558  'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Lists',
559  ];
560  }
561 }
ApiQuery\$QueryMetaModules
static array $QueryMetaModules
List of Api Query meta modules.
Definition: ApiQuery.php:112
ApiMain
This is the main API class, used for both external and internal processing.
Definition: ApiMain.php:44
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:63
ApiQuery\isReadMode
isReadMode()
Indicates whether this module requires read rights.
Definition: ApiQuery.php:513
WikiExporter\schemaVersion
static schemaVersion()
Returns the default export schema version, as defined by $wgXmlDumpSchemaVersion.
Definition: WikiExporter.php:92
ApiQuery\$mParams
$mParams
Definition: ApiQuery.php:135
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:196
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:149
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:1415
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:104
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
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:68
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:546
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:1577
ApiBase\setContinuationManager
setContinuationManager(ApiContinuationManager $manager=null)
Set the continuation manager.
Definition: ApiBase.php:600
ApiBase\getDB
getDB()
Gets a default replica DB connection object.
Definition: ApiBase.php:574
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:71
XmlDumpWriter\$supportedSchemas
static string[] $supportedSchemas
the schema versions supported for output @final
Definition: XmlDumpWriter.php:57
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ApiQuery\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQuery.php:553
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:50
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
ApiQuery\__construct
__construct(ApiMain $main, $action)
Definition: ApiQuery.php:143
ApiResult\setArrayType
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
Definition: ApiResult.php:716
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2463
$modules
$modules
Definition: HTMLFormElement.php:13
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:184
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:695
ApiResult\stripMetadataNonRecursive
static stripMetadataNonRecursive( $data, &$metadata=null)
Remove metadata keys from a data array or object, non-recursive.
Definition: ApiResult.php:1044
$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:604
ApiBase\getPermissionManager
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks.
Definition: ApiBase.php:616
ApiQuery\$QueryListModules
static array $QueryListModules
List of Api Query list modules.
Definition: ApiQuery.php:70
ApiQuery\doExport
doExport( $pageSet, $result)
Definition: ApiQuery.php:442
ApiQuery\getModuleManager
getModuleManager()
Overrides to return this instance's module manager.
Definition: ApiQuery.php:170
Title
Represents a title within MediaWiki.
Definition: Title.php:42
ApiQuery\getCustomPrinter
getCustomPrinter()
Definition: ApiQuery.php:203
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\mergeCacheMode
mergeCacheMode( $cacheMode, $modCacheMode)
Update a cache mode string, applying the cache mode of a new module to it.
Definition: ApiQuery.php:297
ApiQuery\$mPageSet
ApiPageSet $mPageSet
Definition: ApiQuery.php:133
ApiBase\PARAM_DFLT
const PARAM_DFLT
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:66
ApiQuery\outputGeneralPageInfo
outputGeneralPageInfo()
Appends an element for each page in the current pageSet with the most general information (id,...
Definition: ApiQuery.php:340
ApiQuery\getAllowedParams
getAllowedParams( $flags=0)
Definition: ApiQuery.php:479
ApiBase\getParameter
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:815
ApiQuery\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQuery.php:543
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition: ApiBase.php:67
ApiQuery\$mModuleMgr
$mModuleMgr
Definition: ApiQuery.php:137
ApiBase\getMain
getMain()
Get the main module.
Definition: ApiBase.php:442
ApiBase\getHookRunner
getHookRunner()
Get an ApiHookRunner for running core API hooks.
Definition: ApiBase.php:641
ApiQuery\execute
execute()
Query execution happens in the following steps: #1 Create a PageSet object with any pages requested b...
Definition: ApiQuery.php:225
ApiQuery\$QueryPropModules
static array $QueryPropModules
List of Api Query prop modules.
Definition: ApiQuery.php:43
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:1607
ApiQuery\$mNamedDB
$mNamedDB
Definition: ApiQuery.php:136
DumpStringOutput
Definition: DumpStringOutput.php:27
ApiQuery\instantiateModules
instantiateModules(&$modules, $param)
Create instances of all modules requested by the client.
Definition: ApiQuery.php:316
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:463