MediaWiki
REL1_19
|
This is a base class for all Query modules. More...
Public Member Functions | |
__construct (ApiBase $query, $moduleName, $paramPrefix= '') | |
getCacheMode ($params) | |
Get the cache mode for the data generated by this module. | |
getDirectionDescription ($p= '', $extraDirText= '') | |
Gets the personalised direction parameter description. | |
getPossibleErrors () | |
getQuery () | |
Get the main Query module. | |
keyPartToTitle ($keyPart) | |
An alternative to keyToTitle() that doesn't trim trailing spaces. | |
keyToTitle ($key) | |
The inverse of titleToKey() | |
prepareUrlQuerySearchString ($query=null, $protocol=null) | |
requestExtraData ($pageSet) | |
Override this method to request extra fields from the pageSet using $pageSet->requestField('fieldName') | |
selectNamedDB ($name, $db, $groups) | |
Selects the query database connection with the given name. | |
showHiddenUsersAddBlockInfo ($showBlockInfo) | |
Filters hidden users (where the user doesn't have the right to view them) Also adds relevant block information. | |
titlePartToKey ($titlePart) | |
An alternative to titleToKey() that doesn't trim trailing spaces. | |
titleToKey ($title) | |
Convert a title to a DB key. | |
validateSha1Base36Hash ($hash) | |
validateSha1Hash ($hash) | |
Static Public Member Functions | |
static | addTitleInfo (&$arr, $title, $prefix= '') |
Add information (title and namespace) about a Title object to a result array. | |
static | getBaseVersion () |
Get version string for use in the API help output. | |
Public Attributes | |
$fields | |
$join_conds | |
$mDb | |
$options | |
$tables | |
$where | |
Protected Member Functions | |
addFields ($value) | |
Add a set of fields to select to the internal array. | |
addFieldsIf ($value, $condition) | |
Same as addFields(), but add the fields only if a condition is met. | |
addJoinConds ($join_conds) | |
Add a set of JOIN conditions to the internal array. | |
addOption ($name, $value=null) | |
Add an option such as LIMIT or USE INDEX. | |
addPageSubItem ($pageId, $item, $elemname=null) | |
Same as addPageSubItems(), but one element of $data at a time. | |
addPageSubItems ($pageId, $data) | |
Add a sub-element under the page element with the given page ID. | |
addTables ($tables, $alias=null) | |
Add a set of tables to the internal array. | |
addTimestampWhereRange ($field, $dir, $start, $end, $sort=true) | |
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end to database timestamps. | |
addWhere ($value) | |
Add a set of WHERE clauses to the internal array. | |
addWhereFld ($field, $value) | |
Equivalent to addWhere(array($field => $value)) | |
addWhereIf ($value, $condition) | |
Same as addWhere(), but add the WHERE clauses only if a condition is met. | |
addWhereRange ($field, $dir, $start, $end, $sort=true) | |
Add a WHERE clause corresponding to a range, and an ORDER BY clause to sort in the right direction. | |
checkRowCount () | |
Estimate the row count for the SELECT query that would be run if we called select() right now, and check if it's acceptable. | |
getDB () | |
Get the Query database connection (read-only) | |
getPageSet () | |
Get the PageSet object to work on. | |
resetQueryParams () | |
Blank the internal arrays with query parameters. | |
select ($method, $extraQuery=array()) | |
Execute a SELECT query based on the values in the internal arrays. | |
setContinueEnumParameter ($paramName, $paramValue) | |
Set a query-continue value. | |
Private Attributes | |
$mQueryModule |
This is a base class for all Query modules.
It provides some common functionality such as constructing various SQL queries.
Definition at line 34 of file ApiQueryBase.php.
ApiQueryBase::__construct | ( | ApiBase $ | query, |
$ | moduleName, | ||
$ | paramPrefix = '' |
||
) |
$query | ApiBase |
$moduleName | string |
$paramPrefix | string |
Definition at line 43 of file ApiQueryBase.php.
References ApiBase\getMain(), and resetQueryParams().
ApiQueryBase::addFields | ( | $ | value | ) | [protected] |
Add a set of fields to select to the internal array.
$value | array|string Field name or array of field names |
Definition at line 117 of file ApiQueryBase.php.
Referenced by addFieldsIf(), ApiQueryAllUsers\execute(), ApiQueryExternalLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryBacklinks\prepareFirstQuery(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryBacklinks\prepareSecondQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategoryMembers\run(), ApiQueryAllLinks\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllCategories\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), and showHiddenUsersAddBlockInfo().
ApiQueryBase::addFieldsIf | ( | $ | value, |
$ | condition | ||
) | [protected] |
Same as addFields(), but add the fields only if a condition is met.
$value | array|string See addFields() |
$condition | bool If false, do nothing |
Definition at line 131 of file ApiQueryBase.php.
References addFields().
Referenced by ApiQueryAllUsers\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllLinks\run(), ApiQueryCategoryMembers\run(), ApiQueryAllCategories\run(), ApiQueryWatchlist\run(), and ApiQueryRecentChanges\run().
ApiQueryBase::addJoinConds | ( | $ | join_conds | ) | [protected] |
Add a set of JOIN conditions to the internal array.
JOIN conditions are formatted as array( tablename => array(jointype, conditions) e.g. array('page' => array('LEFT JOIN', 'page_id=rev_page')) . conditions may be a string or an addWhere()-style array
$join_conds | array JOIN conditions |
Definition at line 106 of file ApiQueryBase.php.
References $join_conds, and ApiBase\dieDebug().
Referenced by ApiQueryAllUsers\execute(), ApiQueryCategoryInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryRecentChanges\run(), and showHiddenUsersAddBlockInfo().
ApiQueryBase::addOption | ( | $ | name, |
$ | value = null |
||
) | [protected] |
Add an option such as LIMIT or USE INDEX.
If an option was set before, the old value will be overwritten
$name | string Option name |
$value | string Option value |
Definition at line 246 of file ApiQueryBase.php.
Referenced by addWhereRange(), ApiQueryAllUsers\execute(), ApiQueryCategoryInfo\execute(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryRevisions\execute(), ApiQueryBacklinks\prepareFirstQuery(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryBacklinks\prepareSecondQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryDuplicateFiles\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryAllLinks\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), and ApiQueryRecentChanges\run().
ApiQueryBase::addPageSubItem | ( | $ | pageId, |
$ | item, | ||
$ | elemname = null |
||
) | [protected] |
Same as addPageSubItems(), but one element of $data at a time.
$pageId | int Page ID |
$item | array Data array à la ApiResult |
$elemname | string XML element name. If null, getModuleName() is used |
Definition at line 348 of file ApiQueryBase.php.
References $result, ApiBase\getModuleName(), ApiBase\getModulePrefix(), and ApiBase\getResult().
Referenced by ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryImageInfo\execute(), ApiQueryRevisions\execute(), ApiQueryImages\run(), ApiQueryDuplicateFiles\run(), ApiQueryCategories\run(), and ApiQueryLinks\run().
ApiQueryBase::addPageSubItems | ( | $ | pageId, |
$ | data | ||
) | [protected] |
Add a sub-element under the page element with the given page ID.
Definition at line 332 of file ApiQueryBase.php.
References $result, ApiBase\getModuleName(), ApiBase\getModulePrefix(), and ApiBase\getResult().
Referenced by ApiQueryCategoryInfo\execute().
ApiQueryBase::addTables | ( | $ | tables, |
$ | alias = null |
||
) | [protected] |
Add a set of tables to the internal array.
$tables | mixed Table name or array of table names |
$alias | mixed Table alias, or null for no alias. Cannot be used with multiple tables |
Definition at line 82 of file ApiQueryBase.php.
References $tables, and ApiBase\dieDebug().
Referenced by ApiQueryAllUsers\execute(), ApiQueryCategoryInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryLangLinks\execute(), ApiQueryExternalLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryBacklinks\prepareFirstQuery(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryBacklinks\prepareSecondQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllLinks\run(), ApiQueryCategoryMembers\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllCategories\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), and showHiddenUsersAddBlockInfo().
ApiQueryBase::addTimestampWhereRange | ( | $ | field, |
$ | dir, | ||
$ | start, | ||
$ | end, | ||
$ | sort = true |
||
) | [protected] |
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end to database timestamps.
$field | |
$dir | |
$start | |
$end | |
$sort | bool |
Definition at line 234 of file ApiQueryBase.php.
References $dir, and addWhereRange().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryRevisions\execute(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryWatchlist\run(), and ApiQueryRecentChanges\run().
static ApiQueryBase::addTitleInfo | ( | &$ | arr, |
$ | title, | ||
$ | prefix = '' |
||
) | [static] |
Add information (title and namespace) about a Title object to a result array.
Definition at line 305 of file ApiQueryBase.php.
References $title.
Referenced by ApiQueryLogEvents\addLogParams(), ApiQueryDeletedrevs\execute(), ApiPatrol\execute(), ApiQueryFilearchive\execute(), ApiPurge\execute(), ApiQueryBacklinks\extractRedirRowInfo(), ApiQueryRandom\extractRowInfo(), ApiQueryWatchlist\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryBacklinks\extractRowInfo(), ApiQuery\outputGeneralPageInfo(), ApiImportReporter\reportPage(), ApiQueryImages\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQuerySearch\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllLinks\run(), ApiQueryCategoryMembers\run(), ApiQueryQueryPage\run(), ApiQueryAllimages\run(), and ApiQueryLinks\run().
ApiQueryBase::addWhere | ( | $ | value | ) | [protected] |
Add a set of WHERE clauses to the internal array.
Clauses can be formatted as 'foo=bar' or array('foo' => 'bar'), the latter only works if the value is a constant (i.e. not another field)
If $value is an empty array, this function does nothing.
For example, array('foo=bar', 'baz' => 3, 'bla' => 'foo') translates to "foo=bar AND baz='3' AND bla='foo'"
$value | mixed String or array |
Definition at line 150 of file ApiQueryBase.php.
Referenced by addWhereIf(), addWhereRange(), ApiQueryAllUsers\execute(), ApiQueryExternalLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryBacklinks\prepareFirstQuery(), ApiQueryContributions\prepareQuery(), ApiQueryBacklinks\prepareSecondQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllLinks\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), and showHiddenUsersAddBlockInfo().
ApiQueryBase::addWhereFld | ( | $ | field, |
$ | value | ||
) | [protected] |
Equivalent to addWhere(array($field => $value))
$field | string Field name |
$value | string Value; ignored if null or empty array; |
Definition at line 181 of file ApiQueryBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryPageProps\execute(), ApiQueryFilearchive\execute(), ApiQueryLogEvents\execute(), ApiQueryBlocks\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryBacklinks\prepareFirstQuery(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryBacklinks\prepareSecondQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllLinks\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), and ApiQueryRecentChanges\run().
ApiQueryBase::addWhereIf | ( | $ | value, |
$ | condition | ||
) | [protected] |
Same as addWhere(), but add the WHERE clauses only if a condition is met.
$value | mixed See addWhere() |
$condition | bool If false, do nothing |
Definition at line 168 of file ApiQueryBase.php.
References addWhere().
Referenced by ApiQueryBlocks\execute(), ApiQueryContributions\prepareQuery(), ApiQueryWatchlistRaw\run(), ApiQueryWatchlist\run(), and ApiQueryRecentChanges\run().
ApiQueryBase::addWhereRange | ( | $ | field, |
$ | dir, | ||
$ | start, | ||
$ | end, | ||
$ | sort = true |
||
) | [protected] |
Add a WHERE clause corresponding to a range, and an ORDER BY clause to sort in the right direction.
$field | string Field name |
$dir | string If 'newer', sort in ascending order, otherwise sort in descending order |
$start | string Value to start the list at. If $dir == 'newer' this is the lower boundary, otherwise it's the upper boundary |
$end | string Value to end the list at. If $dir == 'newer' this is the upper boundary, otherwise it's the lower boundary |
$sort | bool If false, don't add an ORDER BY clause |
Definition at line 201 of file ApiQueryBase.php.
References $dir, addOption(), addWhere(), and getDB().
Referenced by addTimestampWhereRange(), ApiQueryAllUsers\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryTags\execute(), ApiQueryRevisions\execute(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryAllLinks\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryAllpages\run(), and ApiQueryAllimages\run().
ApiQueryBase::checkRowCount | ( | ) | [protected] |
Estimate the row count for the SELECT query that would be run if we called select() right now, and check if it's acceptable.
Definition at line 285 of file ApiQueryBase.php.
References $wgAPIMaxDBRows, getDB(), ApiBase\profileDBIn(), and ApiBase\profileDBOut().
static ApiQueryBase::getBaseVersion | ( | ) | [static] |
Get version string for use in the API help output.
Reimplemented from ApiBase.
Definition at line 562 of file ApiQueryBase.php.
ApiQueryBase::getCacheMode | ( | $ | params | ) |
Get the cache mode for the data generated by this module.
Override this in the module subclass. For possible return values and other details about cache modes, see ApiMain::setCacheMode()
Public caching will only be allowed if *all* the modules that supply data for a given request return a cache mode of public.
$params |
Reimplemented in ApiQueryInfo, ApiQuerySiteinfo, ApiQueryRevisions, ApiQueryRecentChanges, ApiQueryImageInfo, ApiQueryLogEvents, ApiQueryContributions, ApiQueryAllUsers, ApiQueryUsers, ApiQuerySearch, ApiQueryAllmessages, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryImages, ApiQueryProtectedTitles, ApiQueryQueryPage, ApiQueryRandom, ApiQueryIWLinks, ApiQueryTags, ApiQueryLangLinks, ApiQueryPageProps, ApiQueryBacklinks, ApiQueryExternalLinks, ApiQueryCategoryInfo, ApiQueryLinks, ApiQueryAllimages, ApiQueryAllCategories, ApiQueryAllLinks, ApiQueryAllpages, ApiQueryCategories, ApiQueryCategoryMembers, ApiQueryDuplicateFiles, and ApiQueryExtLinksUsage.
Definition at line 61 of file ApiQueryBase.php.
ApiQueryBase::getDB | ( | ) | [protected] |
Get the Query database connection (read-only)
Reimplemented from ApiBase.
Reimplemented in ApiQueryAllimages.
Definition at line 381 of file ApiQueryBase.php.
References getQuery().
Referenced by addWhereRange(), ApiQuerySiteinfo\appendGeneralInfo(), checkRowCount(), ApiQueryAllUsers\execute(), ApiQueryCategoryInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getProtectionInfo(), ApiPageSet\getRedirectTargets(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiPageSet\initFromPageIds(), ApiPageSet\initFromRevIDs(), ApiPageSet\initFromTitles(), ApiQueryContributions\prepareQuery(), ApiQueryBacklinks\prepareSecondQuery(), ApiPageSet\resolvePendingRedirects(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), ApiQueryCategoryMembers\run(), ApiQueryAllCategories\run(), ApiQueryAllLinks\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), and select().
ApiQueryBase::getDirectionDescription | ( | $ | p = '' , |
$ | extraDirText = '' |
||
) |
Gets the personalised direction parameter description.
string | $p | ModulePrefix |
string | $extraDirText | Any extra text to be appended on the description |
Definition at line 469 of file ApiQueryBase.php.
Referenced by ApiQueryProtectedTitles\getParamDescription(), ApiQueryBlocks\getParamDescription(), ApiQueryDeletedrevs\getParamDescription(), ApiQueryWatchlist\getParamDescription(), ApiQueryContributions\getParamDescription(), ApiQueryLogEvents\getParamDescription(), ApiQueryRecentChanges\getParamDescription(), and ApiQueryRevisions\getParamDescription().
ApiQueryBase::getPageSet | ( | ) | [protected] |
Get the PageSet object to work on.
Definition at line 405 of file ApiQueryBase.php.
References getQuery().
Referenced by ApiQueryCategoryInfo\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryIWLinks\execute(), ApiQueryPageProps\execute(), ApiQueryImageInfo\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\execute(), ApiQueryImages\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), and ApiQueryLinks\run().
Reimplemented from ApiBase.
Reimplemented in ApiPageSet, ApiQueryInfo, ApiQueryRevisions, ApiQuerySiteinfo, ApiQueryRecentChanges, ApiQueryImageInfo, ApiQueryBacklinks, ApiQueryLogEvents, ApiQueryContributions, ApiQueryWatchlist, ApiQueryDeletedrevs, ApiQueryCategoryMembers, ApiQueryAllUsers, ApiQueryBlocks, ApiQueryAllpages, ApiQuerySearch, ApiQueryFilearchive, ApiQueryCategories, ApiQueryExtLinksUsage, ApiQueryAllimages, ApiQueryAllLinks, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryWatchlistRaw, ApiQueryImages, ApiQueryQueryPage, ApiQueryIWLinks, ApiQueryLangLinks, ApiQueryDuplicateFiles, and ApiQueryExternalLinks.
Definition at line 551 of file ApiQueryBase.php.
Get the main Query module.
Definition at line 322 of file ApiQueryBase.php.
Referenced by getDB(), getPageSet(), and selectNamedDB().
ApiQueryBase::keyPartToTitle | ( | $ | keyPart | ) |
An alternative to keyToTitle() that doesn't trim trailing spaces.
$keyPart | string Key part with spaces |
Definition at line 458 of file ApiQueryBase.php.
References keyToTitle().
ApiQueryBase::keyToTitle | ( | $ | key | ) |
The inverse of titleToKey()
$key | string Page title with underscores |
Definition at line 431 of file ApiQueryBase.php.
References $t, and ApiBase\dieUsageMsg().
Referenced by ApiQueryAllUsers\execute(), ApiQueryFilearchive\execute(), keyPartToTitle(), ApiQueryDuplicateFiles\run(), ApiQueryAllCategories\run(), ApiQueryAllLinks\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), and ApiQueryLinks\run().
ApiQueryBase::prepareUrlQuerySearchString | ( | $ | query = null , |
$ | protocol = null |
||
) |
$query | String |
$protocol | String |
Definition at line 482 of file ApiQueryBase.php.
References ApiBase\dieUsage(), LinkFilter\keepOneWildcard(), and LinkFilter\makeLikeArray().
Referenced by ApiQueryExternalLinks\execute(), and ApiQueryExtLinksUsage\run().
ApiQueryBase::requestExtraData | ( | $ | pageSet | ) |
Override this method to request extra fields from the pageSet using $pageSet->requestField('fieldName')
$pageSet | ApiPageSet |
Reimplemented in ApiQueryInfo.
Definition at line 315 of file ApiQueryBase.php.
ApiQueryBase::resetQueryParams | ( | ) | [protected] |
Blank the internal arrays with query parameters.
Definition at line 68 of file ApiQueryBase.php.
Referenced by __construct(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryRandom\prepareQuery(), and ApiQueryBacklinks\run().
ApiQueryBase::select | ( | $ | method, |
$ | extraQuery = array() |
||
) | [protected] |
Execute a SELECT query based on the values in the internal arrays.
$method | string Function the query should be attributed to. You should usually use __METHOD__ here |
$extraQuery | array Query data to add but not store in the object Format is array( 'tables' => ..., 'fields' => ..., 'where' => ..., 'options' => ..., 'join_conds' => ... ) |
Definition at line 262 of file ApiQueryBase.php.
References $fields, $join_conds, $options, $res, $tables, $where, getDB(), ApiBase\profileDBIn(), and ApiBase\profileDBOut().
Referenced by ApiQueryAllUsers\execute(), ApiQueryCategoryInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryPageProps\execute(), ApiQueryFilearchive\execute(), ApiQueryContributions\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategoryMembers\run(), ApiQueryCategories\run(), ApiQueryAllLinks\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllCategories\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), ApiQueryBacklinks\run(), and ApiQueryRandom\runQuery().
ApiQueryBase::selectNamedDB | ( | $ | name, |
$ | db, | ||
$ | groups | ||
) |
Selects the query database connection with the given name.
See ApiQuery::getNamedDB() for more information
$name | string Name to assign to the database connection |
$db | int One of the DB_* constants |
$groups | array Query groups |
Definition at line 397 of file ApiQueryBase.php.
References getQuery().
Referenced by ApiQueryContributions\execute(), ApiQueryWatchlistRaw\run(), and ApiQueryWatchlist\run().
ApiQueryBase::setContinueEnumParameter | ( | $ | paramName, |
$ | paramValue | ||
) | [protected] |
Set a query-continue value.
$paramName | string Parameter name |
$paramValue | string Parameter value |
Definition at line 368 of file ApiQueryBase.php.
References $result, ApiBase\encodeParamName(), ApiBase\getModuleName(), and ApiBase\getResult().
Referenced by ApiQueryPageProps\addPageProps(), ApiQueryTags\doTag(), ApiQueryAllUsers\execute(), ApiQueryCategoryInfo\execute(), ApiQuerySiteinfo\execute(), ApiQueryLangLinks\execute(), ApiQueryAllmessages\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryImageInfo\execute(), ApiQueryContributions\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\execute(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQuerySearch\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllCategories\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllLinks\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllpages\run(), ApiQueryQueryPage\run(), ApiQueryAllimages\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), and ApiQueryBacklinks\run().
ApiQueryBase::showHiddenUsersAddBlockInfo | ( | $ | showBlockInfo | ) |
Filters hidden users (where the user doesn't have the right to view them) Also adds relevant block information.
bool | $showBlockInfo |
Definition at line 510 of file ApiQueryBase.php.
References addFields(), addJoinConds(), addTables(), addWhere(), and ContextSource\getUser().
Referenced by ApiQueryAllUsers\execute(), and ApiQueryUsers\execute().
ApiQueryBase::titlePartToKey | ( | $ | titlePart | ) |
An alternative to titleToKey() that doesn't trim trailing spaces.
$titlePart | string Title part with spaces |
Definition at line 449 of file ApiQueryBase.php.
References titleToKey().
Referenced by ApiQueryFilearchive\execute(), ApiQueryAllCategories\run(), ApiQueryAllLinks\run(), ApiQueryAllpages\run(), and ApiQueryAllimages\run().
ApiQueryBase::titleToKey | ( | $ | title | ) |
Convert a title to a DB key.
$title | string Page title with spaces |
Definition at line 414 of file ApiQueryBase.php.
References $t, $title, ApiBase\dieUsageMsg(), and Title\newFromText().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryIWLinks\execute(), ApiQueryImages\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllLinks\run(), ApiQueryCategories\run(), ApiQueryLinks\run(), and titlePartToKey().
ApiQueryBase::validateSha1Base36Hash | ( | $ | hash | ) |
$hash | string |
Definition at line 544 of file ApiQueryBase.php.
Referenced by ApiQueryFilearchive\execute(), and ApiQueryAllimages\run().
ApiQueryBase::validateSha1Hash | ( | $ | hash | ) |
$hash | string |
Definition at line 536 of file ApiQueryBase.php.
Referenced by ApiQueryFilearchive\execute(), and ApiQueryAllimages\run().
ApiQueryBase::$fields |
Definition at line 36 of file ApiQueryBase.php.
Referenced by ApiPageSet\initFromRevIDs(), and select().
ApiQueryBase::$join_conds |
Definition at line 36 of file ApiQueryBase.php.
Referenced by addJoinConds(), and select().
ApiQueryBase::$mDb |
Definition at line 36 of file ApiQueryBase.php.
ApiQueryBase::$mQueryModule [private] |
Definition at line 36 of file ApiQueryBase.php.
ApiQueryBase::$options |
Definition at line 36 of file ApiQueryBase.php.
Referenced by select().
ApiQueryBase::$tables |
Definition at line 36 of file ApiQueryBase.php.
Referenced by addTables(), ApiPageSet\initFromRevIDs(), ApiQueryContributions\prepareQuery(), and select().
ApiQueryBase::$where |
Definition at line 36 of file ApiQueryBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiPageSet\initFromRevIDs(), and select().