MediaWiki
REL1_24
|
This is a base class for all Query modules. More...
Public Member Functions | |
__construct (ApiQuery $queryModule, $moduleName, $paramPrefix= '') | |
Methods to implement | |
getCacheMode ($params) | |
Get the cache mode for the data generated by this module. | |
requestExtraData ($pageSet) | |
Override this method to request extra fields from the pageSet using $pageSet->requestField('fieldName') | |
Public Attributes | |
$fields | |
$join_conds | |
$mDb | |
$options | |
$tables | |
$where | |
Private Attributes | |
$mQueryModule | |
Data access | |
getQuery () | |
Get the main Query module. | |
selectNamedDB ($name, $db, $groups) | |
Selects the query database connection with the given name. | |
getDB () | |
Get the Query database connection (read-only) | |
getPageSet () | |
Get the PageSet object to work on. | |
Querying | |
prepareUrlQuerySearchString ($query=null, $protocol=null) | |
showHiddenUsersAddBlockInfo ($showBlockInfo) | |
Filters hidden users (where the user doesn't have the right to view them) Also adds relevant block information. | |
resetQueryParams () | |
Blank the internal arrays with query parameters. | |
addTables ($tables, $alias=null) | |
Add a set of tables to the internal array. | |
addJoinConds ($join_conds) | |
Add a set of JOIN conditions to the internal array. | |
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. | |
addWhere ($value) | |
Add a set of WHERE clauses to the internal array. | |
addWhereIf ($value, $condition) | |
Same as addWhere(), but add the WHERE clauses only if a condition is met. | |
addWhereFld ($field, $value) | |
Equivalent to addWhere(array($field => $value)) | |
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. | |
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. | |
addOption ($name, $value=null) | |
Add an option such as LIMIT or USE INDEX. | |
select ($method, $extraQuery=array()) | |
Execute a SELECT query based on the values in the internal arrays. | |
Utility methods | |
titlePartToKey ($titlePart, $namespace=NS_MAIN) | |
Convert an input title or title prefix into a dbkey. | |
getDirectionDescription ($p= '', $extraDirText= '') | |
Gets the personalised direction parameter description. | |
validateSha1Hash ($hash) | |
validateSha1Base36Hash ($hash) | |
userCanSeeRevDel () | |
Check whether the current user has permission to view revision-deleted fields. | |
addPageSubItems ($pageId, $data) | |
Add a sub-element under the page element with the given page ID. | |
addPageSubItem ($pageId, $item, $elemname=null) | |
Same as addPageSubItems(), but one element of $data at a time. | |
setContinueEnumParameter ($paramName, $paramValue) | |
Set a query-continue value. | |
static | addTitleInfo (&$arr, $title, $prefix= '') |
Add information (title and namespace) about a Title object to a result array. | |
Deprecated | |
titleToKey ($title) | |
Convert a title to a DB key. | |
keyToTitle ($key) | |
The inverse of titleToKey() | |
keyPartToTitle ($keyPart) | |
Inverse of titlePartToKey() | |
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. |
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 | ( | ApiQuery $ | queryModule, |
$ | moduleName, | ||
$ | paramPrefix = '' |
||
) |
ApiQuery | $queryModule | |
string | $moduleName | |
string | $paramPrefix |
Reimplemented in ApiQueryImageInfo.
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.
array | string | $value | Field name or array of field names |
Definition at line 184 of file ApiQueryBase.php.
References $value.
Referenced by addFieldsIf(), ApiQueryDeletedrevs\execute(), ApiQueryLangLinks\execute(), ApiQueryExternalLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryTags\execute(), ApiQueryContributors\execute(), ApiQueryAllUsers\execute(), ApiQueryRevisions\execute(), ApiQueryUsers\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryImages\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryLinks\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), and showHiddenUsersAddBlockInfo().
ApiQueryBase::addFieldsIf | ( | $ | value, |
$ | condition | ||
) | [protected] |
Same as addFields(), but add the fields only if a condition is met.
array | string | $value | See addFields() |
bool | $condition | If false, do nothing |
Definition at line 198 of file ApiQueryBase.php.
References $value, and addFields().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryAllUsers\execute(), ApiQueryInfo\getWatchedInfo(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\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
array | $join_conds | JOIN conditions |
Definition at line 173 of file ApiQueryBase.php.
References $join_conds, and ApiBase\dieDebug().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryCategoryInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryContributors\execute(), ApiQueryAllUsers\execute(), ApiQueryRevisions\execute(), ApiQueryUsers\execute(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\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
string | $name | Option name |
string | $value | Option value |
Definition at line 319 of file ApiQueryBase.php.
References $name, $value, and options().
Referenced by addWhereRange(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryPagePropNames\execute(), ApiQueryLogEvents\execute(), ApiQueryTags\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getWatcherInfo(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryImages\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryLinks\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), and ApiQueryRecentChanges\run().
ApiQueryBase::addPageSubItem | ( | $ | pageId, |
$ | item, | ||
$ | elemname = null |
||
) | [protected] |
Same as addPageSubItems(), but one element of $data at a time.
int | $pageId | Page ID |
array | $item | Data array à la ApiResult |
string | $elemname | XML element name. If null, getModuleName() is used |
Definition at line 468 of file ApiQueryBase.php.
References $result, array(), ApiBase\getModuleName(), ApiBase\getModulePrefix(), and ApiBase\getResult().
Referenced by ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryImageInfo\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), ApiQueryImages\run(), ApiQueryDuplicateFiles\run(), ApiQueryCategories\run(), ApiQueryLinks\run(), and ApiQueryBacklinksprop\run().
ApiQueryBase::addPageSubItems | ( | $ | pageId, |
$ | data | ||
) | [protected] |
Add a sub-element under the page element with the given page ID.
Definition at line 451 of file ApiQueryBase.php.
References $result, array(), 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.
string|string[] | $tables Table name or array of table names | |
string | null | $alias | Table alias, or null for no alias. Cannot be used with multiple tables |
Definition at line 149 of file ApiQueryBase.php.
References $tables, ApiBase\dieDebug(), and tables.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryTags\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), ApiQueryUsers\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryLinks\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\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.
string | $field | |
string | $dir | |
string | $start | |
string | $end | |
bool | $sort |
Definition at line 307 of file ApiQueryBase.php.
References $dir, $sort, and addWhereRange().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryRevisions\execute(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllImages\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 440 of file ApiQueryBase.php.
References $title.
Referenced by ApiQueryLogEvents\addLogParams(), ApiImageRotate\addValues(), ApiPatrol\execute(), ApiPurge\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiImageRotate\execute(), ApiQueryRandom\extractRowInfo(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiImportReporter\reportPage(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryQueryPage\run(), ApiQuerySearch\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryBacklinksprop\run(), and ApiQueryAllLinks\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'"
string | array | $value |
Definition at line 219 of file ApiQueryBase.php.
References $value.
Referenced by addWhereIf(), addWhereRange(), ApiQueryExternalLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryLinks\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), and showHiddenUsersAddBlockInfo().
ApiQueryBase::addWhereFld | ( | $ | field, |
$ | value | ||
) | [protected] |
Equivalent to addWhere(array($field => $value))
string | $field | Field name |
string | $value | Value; ignored if null or empty array; |
Definition at line 252 of file ApiQueryBase.php.
References $value.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryPageProps\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), ApiQueryUsers\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryImages\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), and ApiQueryRecentChanges\run().
ApiQueryBase::addWhereIf | ( | $ | value, |
$ | condition | ||
) | [protected] |
Same as addWhere(), but add the WHERE clauses only if a condition is met.
string | array | $value | |
bool | $condition | If false, do nothing |
Definition at line 237 of file ApiQueryBase.php.
References $value, and addWhere().
Referenced by ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryContributions\prepareQuery(), ApiQueryWatchlistRaw\run(), ApiQueryWatchlist\run(), ApiQueryBacklinksprop\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.
string | $field | Field name |
string | $dir | If 'newer', sort in ascending order, otherwise sort in descending order |
string | $start | Value to start the list at. If $dir == 'newer' this is the lower boundary, otherwise it's the upper boundary |
string | $end | Value to end the list at. If $dir == 'newer' this is the upper boundary, otherwise it's the lower boundary |
bool | $sort | If false, don't add an ORDER BY clause |
Definition at line 272 of file ApiQueryBase.php.
References $dir, $sort, addOption(), addWhere(), array(), getDB(), and options().
Referenced by addTimestampWhereRange(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryTags\execute(), ApiQueryAllUsers\execute(), ApiQueryRevisions\execute(), ApiQueryRandom\prepareQuery(), ApiQueryContributions\prepareQuery(), ApiQueryProtectedTitles\run(), ApiQueryCategoryMembers\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), and ApiQueryAllLinks\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 578 of file ApiQueryBase.php.
References ContextSource\getConfig(), getDB(), options(), ApiBase\profileDBIn(), ApiBase\profileDBOut(), tables, and wfDeprecated().
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.
array | $params |
Reimplemented in ApiQuerySiteinfo, ApiQueryInfo, ApiQueryRevisions, ApiQueryImageInfo, ApiQueryRecentChanges, ApiQueryLogEvents, ApiQueryContributions, ApiQueryAllUsers, ApiQueryBacklinksprop, ApiQueryUsers, ApiQuerySearch, ApiQueryContributors, ApiQueryAllMessages, ApiQueryProtectedTitles, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryRandom, ApiQueryIWLinks, ApiQueryImages, ApiQueryLangLinks, ApiQueryQueryPage, ApiQueryTags, ApiQueryPageProps, ApiQueryAllLinks, ApiQueryBacklinks, ApiQueryExternalLinks, ApiQueryCategoryInfo, ApiQueryTokens, ApiQueryPrefixSearch, ApiQueryLinks, ApiQueryFileRepoInfo, ApiQueryAllImages, ApiQueryAllCategories, ApiQueryPagesWithProp, ApiQueryAllPages, ApiQueryCategories, ApiQueryCategoryMembers, ApiQueryDuplicateFiles, ApiQueryExtLinksUsage, and ApiQueryPagePropNames.
Definition at line 66 of file ApiQueryBase.php.
ApiQueryBase::getDB | ( | ) | [protected] |
Get the Query database connection (read-only)
Reimplemented from ApiBase.
Reimplemented in ApiQueryAllImages.
Definition at line 97 of file ApiQueryBase.php.
References getQuery().
Referenced by addWhereRange(), ApiQuerySiteinfo\appendGeneralInfo(), checkRowCount(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryCategoryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryContributors\execute(), ApiQueryAllUsers\execute(), ApiQueryRevisions\execute(), ApiQueryLogEvents\getCacheMode(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiQueryContributions\prepareQuery(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryLinks\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\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 527 of file ApiQueryBase.php.
References array().
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.
Reimplemented in ApiQueryGeneratorBase.
Definition at line 121 of file ApiQueryBase.php.
References getQuery().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryPageProps\execute(), ApiQueryImageInfo\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), and ApiQueryInfo\execute().
Get the main Query module.
Definition at line 89 of file ApiQueryBase.php.
Referenced by ApiQueryUserInfo\getCurrentUserInfo(), getDB(), getPageSet(), and selectNamedDB().
ApiQueryBase::keyPartToTitle | ( | $ | keyPart | ) |
Inverse of titlePartToKey()
string | $keyPart | DBkey, with prefix |
Definition at line 646 of file ApiQueryBase.php.
References keyToTitle(), and wfDeprecated().
ApiQueryBase::keyToTitle | ( | $ | key | ) |
The inverse of titleToKey()
string | $key | Page title with underscores |
Definition at line 625 of file ApiQueryBase.php.
References $key, $t, array(), ApiBase\dieUsageMsg(), Title\newFromDBkey(), and wfDeprecated().
Referenced by keyPartToTitle().
ApiQueryBase::prepareUrlQuerySearchString | ( | $ | query = null , |
$ | protocol = null |
||
) |
string | $query | |
string | $protocol |
Definition at line 379 of file ApiQueryBase.php.
References $query, 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')
ApiPageSet | $pageSet |
Reimplemented in ApiQueryInfo.
Definition at line 75 of file ApiQueryBase.php.
ApiQueryBase::resetQueryParams | ( | ) | [protected] |
Blank the internal arrays with query parameters.
Definition at line 135 of file ApiQueryBase.php.
References array(), options(), and tables.
Referenced by __construct(), ApiQueryContributors\execute(), ApiQueryUsers\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), and ApiQueryRandom\prepareQuery().
ApiQueryBase::select | ( | $ | method, |
$ | extraQuery = array() |
||
) | [protected] |
Execute a SELECT query based on the values in the internal arrays.
string | $method | Function the query should be attributed to. You should usually use __METHOD__ here |
array | $extraQuery | Query data to add but not store in the object Format is array( 'tables' => ..., 'fields' => ..., 'where' => ..., 'options' => ..., 'join_conds' => ... ) |
Definition at line 341 of file ApiQueryBase.php.
References $fields, $join_conds, $options, $res, $tables, $where, array(), getDB(), options(), ApiBase\profileDBIn(), ApiBase\profileDBOut(), and tables.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryTags\execute(), ApiQueryContributors\execute(), ApiQueryAllUsers\execute(), ApiQueryRevisions\execute(), ApiQueryUsers\execute(), ApiQueryInfo\getDisplayTitle(), ApiQueryInfo\getProtectionInfo(), ApiQueryInfo\getTSIDs(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryImages\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), and ApiQueryRandom\runQuery().
ApiQueryBase::selectNamedDB | ( | $ | name, |
$ | db, | ||
$ | groups | ||
) |
Selects the query database connection with the given name.
See ApiQuery::getNamedDB() for more information
string | $name | Name to assign to the database connection |
int | $db | One of the DB_* constants |
array | $groups | Query groups |
Definition at line 113 of file ApiQueryBase.php.
References $name, and getQuery().
Referenced by ApiQueryContributions\execute(), ApiQueryWatchlistRaw\run(), and ApiQueryWatchlist\run().
ApiQueryBase::setContinueEnumParameter | ( | $ | paramName, |
$ | paramValue | ||
) | [protected] |
Set a query-continue value.
string | $paramName | Parameter name |
string | array | $paramValue | Parameter value |
Reimplemented in ApiQueryGeneratorBase.
Definition at line 489 of file ApiQueryBase.php.
References ApiBase\getResult().
Referenced by ApiQueryPageProps\addPageProps(), ApiQueryORM\addResults(), ApiQueryTags\doTag(), ApiQuerySiteinfo\execute(), ApiQueryAllMessages\execute(), ApiQueryLangLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryBlocks\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryImageInfo\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiQueryRevisions\execute(), ApiQueryUsers\execute(), and ApiQueryInfo\execute().
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 408 of file ApiQueryBase.php.
References addFields(), addJoinConds(), addTables(), addWhere(), array(), and ContextSource\getUser().
Referenced by ApiQueryAllUsers\execute(), and ApiQueryUsers\execute().
ApiQueryBase::titlePartToKey | ( | $ | titlePart, |
$ | namespace = NS_MAIN |
||
) |
Convert an input title or title prefix into a dbkey.
$namespace should always be specified in order to handle per-namespace capitalization settings.
string | $titlePart | Title part |
int | $defaultNamespace | Namespace of the title |
Definition at line 503 of file ApiQueryBase.php.
References $t, array(), ApiBase\dieUsageMsg(), and Title\makeTitleSafe().
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryAllCategories\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), and ApiQueryAllLinks\run().
ApiQueryBase::titleToKey | ( | $ | title | ) |
Convert a title to a DB key.
string | $title | Page title with spaces |
Definition at line 605 of file ApiQueryBase.php.
References $t, $title, array(), ApiBase\dieUsageMsg(), Title\newFromText(), and wfDeprecated().
Check whether the current user has permission to view revision-deleted fields.
Definition at line 556 of file ApiQueryBase.php.
References ContextSource\getUser().
Referenced by ApiQueryLogEvents\getCacheMode(), ApiQueryRecentChanges\getCacheMode(), ApiQueryImageInfo\getCacheMode(), and ApiQueryRevisions\getCacheMode().
ApiQueryBase::validateSha1Base36Hash | ( | $ | hash | ) |
string | $hash |
Definition at line 547 of file ApiQueryBase.php.
Referenced by ApiQueryFilearchive\execute(), and ApiQueryAllImages\run().
ApiQueryBase::validateSha1Hash | ( | $ | hash | ) |
string | $hash |
Definition at line 539 of file ApiQueryBase.php.
Referenced by ApiQueryFilearchive\execute(), and ApiQueryAllImages\run().
ApiQueryBase::$fields |
Definition at line 36 of file ApiQueryBase.php.
Referenced by ApiQueryORM\getConditions(), 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(), ApiQueryContributions\prepareQuery(), and select().
ApiQueryBase::$where |
Definition at line 36 of file ApiQueryBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryBacklinksprop\run(), and select().