MediaWiki
REL1_24
|
This is the main query class. More...
Public Member Functions | |
__construct (ApiMain $main, $action) | |
execute () | |
Query execution happens in the following steps: #1 Create a PageSet object with any pages requested by the user #2 If using a generator, execute it to get a new ApiPageSet object #3 Instantiate all requested modules. | |
getAllowedParams ($flags=0) | |
getCustomPrinter () | |
getDescription () | |
Returns the description string for this module. | |
getExamples () | |
Returns usage examples for this module. | |
getGenerators () | |
Get the generators array mapping module names to class names. | |
getHelpUrls () | |
getModuleManager () | |
Overrides to return this instance's module manager. | |
getModules () | |
Get the array mapping module names to class names. | |
getModuleType ($moduleName) | |
Get whether the specified module is a prop, list or a meta query module. | |
getNamedDB ($name, $db, $groups) | |
Get the query database connection with the given name. | |
getPageSet () | |
Gets the set of pages the user has requested (or generated) | |
getParamDescription () | |
Returns an array of parameter descriptions. | |
makeHelpMsg () | |
Override the parent to generate help messages for all available query modules. | |
setGeneratorContinue ($module, $paramName, $paramValue) | |
This method is called by the generator base when generator in the smart-continue mode tries to set 'query-continue' value. | |
shouldCheckMaxlag () | |
Indicates if this module needs maxlag to be checked. | |
Protected Member Functions | |
mergeCacheMode ($cacheMode, $modCacheMode) | |
Update a cache mode string, applying the cache mode of a new module to it. | |
Private Member Functions | |
doExport ($pageSet, $result) | |
instantiateModules (&$modules, $param) | |
Create instances of all modules requested by the client. | |
makeHelpMsgHelper ($group) | |
For all modules of a given group, generate help messages and join them together. | |
outputGeneralPageInfo () | |
Appends an element for each page in the current pageSet with the most general information (id, title), plus any title normalizations and missing or invalid title/pageids/revids. | |
Private Attributes | |
$mModuleMgr | |
$mNamedDB = array() | |
ApiPageSet | $mPageSet |
$mParams | |
Static Private Attributes | |
static | $QueryListModules |
static | $QueryMetaModules |
static | $QueryPropModules |
This is the main query class.
It behaves similar to ApiMain: based on the parameters given, it will create a list of titles to work on (an ApiPageSet object), instantiate and execute various property/list/meta modules, and assemble all resulting data into a single ApiResult object.
In generator mode, a generator will be executed first to populate a second ApiPageSet object, and that object will be used for all subsequent modules.
Definition at line 38 of file ApiQuery.php.
ApiQuery::__construct | ( | ApiMain $ | main, |
$ | action | ||
) |
ApiMain | $main | |
string | $action |
Definition at line 129 of file ApiQuery.php.
ApiQuery::doExport | ( | $ | pageSet, |
$ | result | ||
) | [private] |
ApiPageSet | $pageSet | Pages to be exported |
ApiResult | $result | Result to output to |
Definition at line 472 of file ApiQuery.php.
Query execution happens in the following steps: #1 Create a PageSet object with any pages requested by the user #2 If using a generator, execute it to get a new ApiPageSet object #3 Instantiate all requested modules.
This way the PageSet object will know what shared data is required, and minimize DB calls. #4 Output all normalization and redirect resolution information #5 Execute all requested modules
Reimplemented from ApiBase.
Definition at line 246 of file ApiQuery.php.
ApiQuery::getAllowedParams | ( | $ | flags = 0 | ) |
Definition at line 512 of file ApiQuery.php.
References $flags, $result, array(), getPageSet(), ApiBase\PARAM_ISMULTI, and ApiBase\PARAM_TYPE.
Returns the description string for this module.
Reimplemented from ApiBase.
Definition at line 619 of file ApiQuery.php.
References array().
Returns usage examples for this module.
Return false if no examples are available.
Reimplemented from ApiBase.
Definition at line 629 of file ApiQuery.php.
References array().
Get the generators array mapping module names to class names.
Definition at line 199 of file ApiQuery.php.
Reimplemented from ApiBase.
Definition at line 637 of file ApiQuery.php.
References array().
Overrides to return this instance's module manager.
Reimplemented from ApiBase.
Definition at line 151 of file ApiQuery.php.
Get the array mapping module names to class names.
Definition at line 188 of file ApiQuery.php.
ApiQuery::getModuleType | ( | $ | moduleName | ) |
Get whether the specified module is a prop, list or a meta query module.
string | $moduleName | Name of the module to find type for |
Definition at line 217 of file ApiQuery.php.
ApiQuery::getNamedDB | ( | $ | name, |
$ | db, | ||
$ | groups | ||
) |
Get the query database connection with the given name.
If no such connection has been requested before, it will be created. Subsequent calls with the same $name will return the same connection as the first, regardless of the values of $db and $groups
string | $name | Name to assign to the database connection |
int | $db | One of the DB_* constants |
array | $groups | Query groups |
Definition at line 165 of file ApiQuery.php.
Gets the set of pages the user has requested (or generated)
Definition at line 179 of file ApiQuery.php.
Referenced by getAllowedParams(), and getParamDescription().
Returns an array of parameter descriptions.
Don't call this function directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.
Reimplemented from ApiBase.
Definition at line 596 of file ApiQuery.php.
References array(), and getPageSet().
ApiQuery::instantiateModules | ( | &$ | modules, |
$ | param | ||
) | [private] |
Create instances of all modules requested by the client.
array | $modules | To append instantiated modules to |
string | $param | Parameter name to read modules from |
Definition at line 326 of file ApiQuery.php.
Override the parent to generate help messages for all available query modules.
Reimplemented from ApiBase.
Definition at line 544 of file ApiQuery.php.
ApiQuery::makeHelpMsgHelper | ( | $ | group | ) | [private] |
For all modules of a given group, generate help messages and join them together.
string | $group | Module group |
Definition at line 567 of file ApiQuery.php.
ApiQuery::mergeCacheMode | ( | $ | cacheMode, |
$ | modCacheMode | ||
) | [protected] |
Update a cache mode string, applying the cache mode of a new module to it.
The cache mode may increase in the level of privacy, but public modules added to private data do not decrease the level of privacy.
string | $cacheMode | |
string | $modCacheMode |
Definition at line 307 of file ApiQuery.php.
ApiQuery::outputGeneralPageInfo | ( | ) | [private] |
Appends an element for each page in the current pageSet with the most general information (id, title), plus any title normalizations and missing or invalid title/pageids/revids.
Definition at line 350 of file ApiQuery.php.
ApiQuery::setGeneratorContinue | ( | $ | module, |
$ | paramName, | ||
$ | paramValue | ||
) |
This method is called by the generator base when generator in the smart-continue mode tries to set 'query-continue' value.
ApiQuery stores those values separately until the post-processing when it is known if the generation should continue or repeat.
ApiQueryGeneratorBase | $module | Generator module |
string | $paramName | |
mixed | $paramValue |
Definition at line 462 of file ApiQuery.php.
Indicates if this module needs maxlag to be checked.
Reimplemented from ApiBase.
Definition at line 592 of file ApiQuery.php.
ApiQuery::$mModuleMgr [private] |
Definition at line 123 of file ApiQuery.php.
ApiQuery::$mNamedDB = array() [private] |
Definition at line 122 of file ApiQuery.php.
ApiPageSet ApiQuery::$mPageSet [private] |
Definition at line 119 of file ApiQuery.php.
ApiQuery::$mParams [private] |
Definition at line 121 of file ApiQuery.php.
ApiQuery::$QueryListModules [static, private] |
Definition at line 70 of file ApiQuery.php.
ApiQuery::$QueryMetaModules [static, private] |
array( 'allmessages' => 'ApiQueryAllMessages', 'siteinfo' => 'ApiQuerySiteinfo', 'userinfo' => 'ApiQueryUserInfo', 'filerepoinfo' => 'ApiQueryFileRepoInfo', 'tokens' => 'ApiQueryTokens', )
Definition at line 109 of file ApiQuery.php.
ApiQuery::$QueryPropModules [static, private] |
array( 'categories' => 'ApiQueryCategories', 'categoryinfo' => 'ApiQueryCategoryInfo', 'contributors' => 'ApiQueryContributors', 'duplicatefiles' => 'ApiQueryDuplicateFiles', 'extlinks' => 'ApiQueryExternalLinks', 'fileusage' => 'ApiQueryBacklinksprop', 'images' => 'ApiQueryImages', 'imageinfo' => 'ApiQueryImageInfo', 'info' => 'ApiQueryInfo', 'links' => 'ApiQueryLinks', 'linkshere' => 'ApiQueryBacklinksprop', 'iwlinks' => 'ApiQueryIWLinks', 'langlinks' => 'ApiQueryLangLinks', 'pageprops' => 'ApiQueryPageProps', 'redirects' => 'ApiQueryBacklinksprop', 'revisions' => 'ApiQueryRevisions', 'stashimageinfo' => 'ApiQueryStashImageInfo', 'templates' => 'ApiQueryLinks', 'transcludedin' => 'ApiQueryBacklinksprop', )
Definition at line 44 of file ApiQuery.php.