MediaWiki
REL1_24
|
A query module to show basic page information. More...
Public Member Functions | |
__construct (ApiQuery $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. | |
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 | |
$fld_watchers = false | |
$missing | |
$notificationtimestamps | |
$pageCounter | |
$pageIsNew | |
$pageIsRedir | |
$pageLatest | |
$pageLength | |
$pageTouched | |
$subjectids | |
$talkids | |
$titles | |
$watched | |
$watchers | |
Protected Member Functions | |
getTokenFunctions () | |
Get an array mapping token names to their handler functions. | |
Static Protected Attributes | |
static | $cachedTokens = array() |
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. | |
getWatcherInfo () | |
Get the count of watchers and put it in $this->watchers. | |
Private Attributes | |
$fld_protection = false | |
$pageRestrictions | |
$params | |
$protections | |
$showZeroWatchers = false | |
$tokenFunctions |
A query module to show basic page information.
Definition at line 32 of file ApiQueryInfo.php.
ApiQueryInfo::__construct | ( | ApiQuery $ | query, |
$ | moduleName | ||
) |
Definition at line 51 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 285 of file ApiQueryInfo.php.
References $result, $title, array(), as, Title\compare(), ApiBase\dieContinueUsageIf(), extractPageInfo(), ApiBase\extractRequestParams(), ContextSource\getConfig(), getDisplayTitle(), ApiQueryBase\getPageSet(), getProtectionInfo(), ApiBase\getResult(), getTSIDs(), getWatchedInfo(), getWatcherInfo(), Title\makeTitleSafe(), and ApiQueryBase\setContinueEnumParameter().
ApiQueryInfo::extractPageInfo | ( | $ | pageid, |
$ | title | ||
) | [private] |
Get a result array with information about a title.
Definition at line 382 of file ApiQueryInfo.php.
References $t, $title, $tokenFunctions, array(), as, ContextSource\getConfig(), 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.
Some derived classes may choose to handle an integer $flags parameter in the overriding methods. Callers of this method can pass zero or more OR-ed flags like GET_VALUES_FOR_HELP.
Reimplemented from ApiBase.
Definition at line 802 of file ApiQueryInfo.php.
References array(), getTokenFunctions(), ApiBase\PARAM_DEPRECATED, ApiBase\PARAM_DFLT, ApiBase\PARAM_ISMULTI, and ApiBase\PARAM_TYPE.
static ApiQueryInfo::getBlockToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 195 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
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.
array | $params |
Reimplemented from ApiQueryBase.
Definition at line 779 of file ApiQueryInfo.php.
static ApiQueryInfo::getDeleteToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 144 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
Returns the description string for this module.
Reimplemented from ApiBase.
Definition at line 851 of file ApiQueryInfo.php.
ApiQueryInfo::getDisplayTitle | ( | ) | [private] |
Definition at line 678 of file ApiQueryInfo.php.
References $res, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhereFld(), array(), as, ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getEditToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 124 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
static ApiQueryInfo::getEmailToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 220 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
Returns usage examples for this module.
Return false if no examples are available.
Reimplemented from ApiBase.
Definition at line 855 of file ApiQueryInfo.php.
References array().
Reimplemented from ApiBase.
Definition at line 862 of file ApiQueryInfo.php.
static ApiQueryInfo::getImportToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 237 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
static ApiQueryInfo::getMoveToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 178 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
static ApiQueryInfo::getOptionsToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 271 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
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 831 of file ApiQueryInfo.php.
References array().
ApiQueryInfo::getProtectionInfo | ( | ) | [private] |
Get information about protections and put it in $protections.
Definition at line 492 of file ApiQueryInfo.php.
References $lb, $res, $source, $title, $wgContLang, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), ApiQueryBase\addWhereFld(), array(), as, ApiQueryBase\getDB(), global, Title\makeTitle(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getProtectToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 161 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
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 85 of file ApiQueryInfo.php.
References array(), ApiBase\getMain(), ContextSource\getRequest(), and wfRunHooks().
Referenced by extractPageInfo(), and getAllowedParams().
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 640 of file ApiQueryInfo.php.
References $lb, $res, $t, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), array(), as, 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 212 of file ApiQueryInfo.php.
References $title, and getBlockToken().
ApiQueryInfo::getWatchedInfo | ( | ) | [private] |
Get information about watched status and put it in $this->watched and $this->notificationtimestamps.
Definition at line 703 of file ApiQueryInfo.php.
References $lb, $res, $user, ApiQueryBase\addFields(), ApiQueryBase\addFieldsIf(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), array(), as, ApiQueryBase\getDB(), ContextSource\getUser(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
ApiQueryInfo::getWatcherInfo | ( | ) | [private] |
Get the count of watchers and put it in $this->watchers.
Definition at line 743 of file ApiQueryInfo.php.
References $lb, $res, $user, ApiQueryBase\addFields(), ApiQueryBase\addOption(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), array(), as, ContextSource\getConfig(), ApiQueryBase\getDB(), ContextSource\getUser(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().
Referenced by execute().
static ApiQueryInfo::getWatchToken | ( | $ | pageid, |
$ | title | ||
) | [static] |
Definition at line 254 of file ApiQueryInfo.php.
References $cachedTokens, $wgUser, and global.
ApiQueryInfo::requestExtraData | ( | $ | pageSet | ) |
ApiPageSet | $pageSet |
Reimplemented from ApiQueryBase.
Definition at line 59 of file ApiQueryInfo.php.
References ContextSource\getConfig().
static ApiQueryInfo::resetTokenCache | ( | ) | [static] |
Definition at line 117 of file ApiQueryInfo.php.
References $cachedTokens, and array().
Referenced by ApiLogin\execute(), and ApiTestCase\setUp().
ApiQueryInfo::$cachedTokens = array() [static, protected] |
Definition at line 112 of file ApiQueryInfo.php.
Referenced by getBlockToken(), getDeleteToken(), getEditToken(), getEmailToken(), getImportToken(), getMoveToken(), getOptionsToken(), getProtectToken(), getWatchToken(), and resetTokenCache().
ApiQueryInfo::$displaytitles |
Definition at line 45 of file ApiQueryInfo.php.
ApiQueryInfo::$everything |
Definition at line 40 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_displaytitle = false |
Definition at line 38 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_notificationtimestamp = false |
Definition at line 37 of file ApiQueryInfo.php.
ApiQueryInfo::$fld_preload = false |
Definition at line 38 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::$fld_watchers = false |
Definition at line 36 of file ApiQueryInfo.php.
ApiQueryInfo::$missing |
Definition at line 40 of file ApiQueryInfo.php.
ApiQueryInfo::$notificationtimestamps |
Definition at line 45 of file ApiQueryInfo.php.
ApiQueryInfo::$pageCounter |
Definition at line 40 of file ApiQueryInfo.php.
ApiQueryInfo::$pageIsNew |
Definition at line 42 of file ApiQueryInfo.php.
ApiQueryInfo::$pageIsRedir |
Definition at line 42 of file ApiQueryInfo.php.
ApiQueryInfo::$pageLatest |
Definition at line 42 of file ApiQueryInfo.php.
ApiQueryInfo::$pageLength |
Definition at line 42 of file ApiQueryInfo.php.
ApiQueryInfo::$pageRestrictions [private] |
Definition at line 42 of file ApiQueryInfo.php.
ApiQueryInfo::$pageTouched |
Definition at line 42 of file ApiQueryInfo.php.
ApiQueryInfo::$params [private] |
Definition at line 40 of file ApiQueryInfo.php.
Referenced by getCacheMode().
ApiQueryInfo::$protections [private] |
Definition at line 45 of file ApiQueryInfo.php.
ApiQueryInfo::$showZeroWatchers = false [private] |
Definition at line 47 of file ApiQueryInfo.php.
ApiQueryInfo::$subjectids |
Definition at line 45 of file ApiQueryInfo.php.
ApiQueryInfo::$talkids |
Definition at line 45 of file ApiQueryInfo.php.
ApiQueryInfo::$titles |
Definition at line 40 of file ApiQueryInfo.php.
ApiQueryInfo::$tokenFunctions [private] |
Definition at line 49 of file ApiQueryInfo.php.
Referenced by extractPageInfo().
ApiQueryInfo::$watched |
Definition at line 45 of file ApiQueryInfo.php.
ApiQueryInfo::$watchers |
Definition at line 45 of file ApiQueryInfo.php.