MediaWiki
REL1_20
|
A query module to show basic page information. More...
Public Member Functions | |
__construct ($query, $moduleName) | |
execute () | |
Evaluates the parameters, performs the requested query, and sets up the result. | |
getAllowedParams () | |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed. | |
getCacheMode ($params) | |
Get the cache mode for the data generated by this module. | |
getDescription () | |
Returns the description string for this module. | |
getExamples () | |
Returns usage examples for this module. | |
getHelpUrls () | |
getParamDescription () | |
Returns an array of parameter descriptions. | |
getPossibleErrors () | |
getResultProperties () | |
Returns possible properties in the result, grouped by the value of the prop parameter that shows them. | |
getVersion () | |
Returns a string that identifies the version of the extending class. | |
requestExtraData ($pageSet) | |
Static Public Member Functions | |
static | getBlockToken ($pageid, $title) |
static | getDeleteToken ($pageid, $title) |
static | getEditToken ($pageid, $title) |
static | getEmailToken ($pageid, $title) |
static | getImportToken ($pageid, $title) |
static | getMoveToken ($pageid, $title) |
static | getOptionsToken ($pageid, $title) |
static | getProtectToken ($pageid, $title) |
static | getUnblockToken ($pageid, $title) |
static | getWatchToken ($pageid, $title) |
static | resetTokenCache () |
Public Attributes | |
$displaytitles | |
$everything | |
$fld_displaytitle = false | |
$fld_notificationtimestamp = false | |
$fld_preload = false | |
$fld_readable = false | |
$fld_subjectid = false | |
$fld_talkid = false | |
$fld_url = false | |
$fld_watched = false | |
$missing | |
$notificationtimestamps | |
$pageCounter | |
$pageIsNew | |
$pageIsRedir | |
$pageLatest | |
$pageLength | |
$pageTouched | |
$subjectids | |
$talkids | |
$titles | |
$watched | |
Static Public Attributes | |
static | $cachedTokens = array() |
Protected Member Functions | |
getTokenFunctions () | |
Get an array mapping token names to their handler functions. | |
Private Member Functions | |
extractPageInfo ($pageid, $title) | |
Get a result array with information about a title. | |
getDisplayTitle () | |
getProtectionInfo () | |
Get information about protections and put it in $protections. | |
getTSIDs () | |
Get talk page IDs (if requested) and subject page IDs (if requested) and put them in $talkids and $subjectids. | |
getWatchedInfo () | |
Get information about watched status and put it in $this->watched and $this->notificationtimestamps. | |
Private Attributes | |
$fld_protection = false | |
$pageRestrictions | |
$params | |
$protections | |
$tokenFunctions |
A query module to show basic page information.
Definition at line 32 of file ApiQueryInfo.php.
ApiQueryInfo::__construct | ( | $ | query, |
$ | moduleName | ||
) |
Definition at line 48 of file ApiQueryInfo.php.
Evaluates the parameters, performs the requested query, and sets up the result.
Concrete implementations of ApiBase must override this method to provide whatever functionality their module offers. Implementations must not produce any output on their own and are not expected to handle any errors.
The execute() method will be invoked directly by ApiMain immediately before the result of the module is output. Aside from the constructor, implementations should assume that no other methods will be called externally on the module before the result is processed.
The result data should be stored in the ApiResult object available through getResult().
Reimplemented from ApiBase.
Definition at line 245 of file ApiQueryInfo.php.
References $result, $title, $wgDisableCounters, Title\compare(), ApiBase\dieUsage(), extractPageInfo(), ApiBase\extractRequestParams(), getDisplayTitle(), ApiQueryBase\getPageSet(), getProtectionInfo(), ApiBase\getResult(), getTSIDs(), getWatchedInfo(), Title\makeTitleSafe(), and ApiQueryBase\setContinueEnumParameter().
ApiQueryInfo::extractPageInfo | ( | $ | pageid, |
$ | title | ||
) | [private] |
Get a result array with information about a title.
Definition at line 341 of file ApiQueryInfo.php.
References $t, $title, $tokenFunctions, $wgDisableCounters, ApiBase\getResult(), getTokenFunctions(), ApiBase\setWarning(), wfExpandUrl(), wfRunHooks(), and wfTimestamp().
Referenced by execute().
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.
Reimplemented from ApiBase.
Definition at line 703 of file ApiQueryInfo.php.
References getTokenFunctions(), ApiBase\PARAM_DFLT, ApiBase\PARAM_ISMULTI, and ApiBase\PARAM_TYPE.
static ApiQueryInfo::getBlockToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 170 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
Referenced by getUnblockToken().
ApiQueryInfo::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 from ApiQueryBase.
Definition at line 681 of file ApiQueryInfo.php.
References $params.
static ApiQueryInfo::getDeleteToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 128 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
Returns the description string for this module.
Reimplemented from ApiBase.
Definition at line 808 of file ApiQueryInfo.php.
ApiQueryInfo::getDisplayTitle | ( | ) | [private] |
Definition at line 622 of file ApiQueryInfo.php.
References $res, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhereFld(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getEditToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 111 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
static ApiQueryInfo::getEmailToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 189 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
Returns usage examples for this module.
Return false if no examples are available.
Reimplemented from ApiBase.
Definition at line 818 of file ApiQueryInfo.php.
Reimplemented from ApiBase.
Definition at line 825 of file ApiQueryInfo.php.
static ApiQueryInfo::getImportToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 203 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
static ApiQueryInfo::getMoveToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 156 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
static ApiQueryInfo::getOptionsToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 231 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
Returns an array of parameter descriptions.
Don't call this functon directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.
Reimplemented from ApiBase.
Definition at line 730 of file ApiQueryInfo.php.
ApiQueryInfo::getProtectionInfo | ( | ) | [private] |
Get information about protections and put it in $protections.
Definition at line 438 of file ApiQueryInfo.php.
References $lb, $res, $source, $title, $wgContLang, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), ApiQueryBase\addWhereFld(), ApiQueryBase\getDB(), Title\makeTitle(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getProtectToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 142 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
Returns possible properties in the result, grouped by the value of the prop parameter that shows them.
Properties that are shown always are in a group with empty string as a key. Properties that can be shown by several values of prop are included multiple times. If some properties are part of a list and some are on the root object (see ApiQueryQueryPage), those on the root object are under the key PROP_ROOT. The array can also contain a boolean under the key PROP_LIST, indicating whether the result is a list.
Don't call this functon directly: use getFinalResultProperties() to allow hooks to modify descriptions as needed.
Reimplemented from ApiBase.
Definition at line 749 of file ApiQueryInfo.php.
References ApiBase\addTokenProperties(), getTokenFunctions(), ApiBase\PROP_LIST, ApiBase\PROP_NULLABLE, and ApiBase\PROP_TYPE.
ApiQueryInfo::getTokenFunctions | ( | ) | [protected] |
Get an array mapping token names to their handler functions.
The prototype for a token function is func($pageid, $title) it should return a token or false (permission denied)
Definition at line 79 of file ApiQueryInfo.php.
References ApiBase\getMain(), ContextSource\getRequest(), and wfRunHooks().
Referenced by extractPageInfo(), getAllowedParams(), and getResultProperties().
ApiQueryInfo::getTSIDs | ( | ) | [private] |
Get talk page IDs (if requested) and subject page IDs (if requested) and put them in $talkids and $subjectids.
Definition at line 585 of file ApiQueryInfo.php.
References $lb, $res, $t, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), ApiQueryBase\getDB(), MWNamespace\getSubject(), MWNamespace\getTalk(), MWNamespace\isTalk(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getUnblockToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 184 of file ApiQueryInfo.php.
References $title, and getBlockToken().
Returns a string that identifies the version of the extending class.
Typically includes the class name, the svn revision, timestamp, and last author. Usually done with SVN's Id keyword
Reimplemented from ApiBase.
Definition at line 829 of file ApiQueryInfo.php.
ApiQueryInfo::getWatchedInfo | ( | ) | [private] |
Get information about watched status and put it in $this->watched and $this->notificationtimestamps.
Definition at line 647 of file ApiQueryInfo.php.
References $lb, $res, $user, ApiQueryBase\addFields(), ApiQueryBase\addFieldsIf(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), ApiQueryBase\getDB(), ContextSource\getUser(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getWatchToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 217 of file ApiQueryInfo.php.
References $cachedTokens, and $wgUser.
Referenced by ResourceLoaderUserTokensModule\contextUserTokens().
ApiQueryInfo::requestExtraData | ( | $ | pageSet | ) |
$pageSet | ApiPageSet |
Reimplemented from ApiQueryBase.
Definition at line 56 of file ApiQueryInfo.php.
References $wgDisableCounters.
static ApiQueryInfo::resetTokenCache | ( | ) | [static] |
Definition at line 107 of file ApiQueryInfo.php.
References $cachedTokens.
Referenced by ApiLogin\execute().
ApiQueryInfo::$cachedTokens = array() [static] |
Definition at line 105 of file ApiQueryInfo.php.
Referenced by getBlockToken(), getDeleteToken(), getEditToken(), getEmailToken(), getImportToken(), getMoveToken(), getOptionsToken(), getProtectToken(), getWatchToken(), and resetTokenCache().
ApiQueryInfo::$displaytitles |
Definition at line 44 of file ApiQueryInfo.php.
ApiQueryInfo::$everything |
Definition at line 39 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_displaytitle = false |
Definition at line 37 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_notificationtimestamp = false |
Definition at line 36 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_preload = false |
Definition at line 37 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_protection = false [private] |
Definition at line 34 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_readable = false |
Definition at line 36 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_subjectid = false |
Definition at line 35 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_talkid = false |
Definition at line 34 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_url = false |
Definition at line 35 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_watched = false |
Definition at line 36 of file ApiQueryInfo.php.
ApiQueryInfo::$missing |
Definition at line 39 of file ApiQueryInfo.php.
ApiQueryInfo::$notificationtimestamps |
Definition at line 44 of file ApiQueryInfo.php.
ApiQueryInfo::$pageCounter |
Definition at line 39 of file ApiQueryInfo.php.
ApiQueryInfo::$pageIsNew |
Definition at line 41 of file ApiQueryInfo.php.
ApiQueryInfo::$pageIsRedir |
Definition at line 41 of file ApiQueryInfo.php.
ApiQueryInfo::$pageLatest |
Definition at line 41 of file ApiQueryInfo.php.
ApiQueryInfo::$pageLength |
Definition at line 41 of file ApiQueryInfo.php.
ApiQueryInfo::$pageRestrictions [private] |
Definition at line 41 of file ApiQueryInfo.php.
ApiQueryInfo::$pageTouched |
Definition at line 41 of file ApiQueryInfo.php.
ApiQueryInfo::$params [private] |
Definition at line 39 of file ApiQueryInfo.php.
Referenced by getCacheMode().
ApiQueryInfo::$protections [private] |
Definition at line 44 of file ApiQueryInfo.php.
ApiQueryInfo::$subjectids |
Definition at line 44 of file ApiQueryInfo.php.
ApiQueryInfo::$talkids |
Definition at line 44 of file ApiQueryInfo.php.
ApiQueryInfo::$titles |
Definition at line 39 of file ApiQueryInfo.php.
ApiQueryInfo::$tokenFunctions [private] |
Definition at line 46 of file ApiQueryInfo.php.
Referenced by extractPageInfo().
ApiQueryInfo::$watched |
Definition at line 44 of file ApiQueryInfo.php.