MediaWiki  REL1_19
ApiQueryInfo Class Reference

A query module to show basic page information. More...

Inheritance diagram for ApiQueryInfo:
Collaboration diagram for ApiQueryInfo:

List of all members.

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 ()
 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 getProtectToken ($pageid, $title)
static getUnblockToken ($pageid, $title)
static getWatchToken ($pageid, $title)

Public Attributes

 $displaytitles
 $everything
 $fld_displaytitle = false
 $fld_preload = false
 $fld_readable = false
 $fld_subjectid = false
 $fld_talkid = false
 $fld_url = false
 $fld_watched = false
 $missing
 $pageCounter
 $pageIsNew
 $pageIsRedir
 $pageLatest
 $pageLength
 $pageTouched
 $subjectids
 $talkids
 $titles
 $watched

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.

Private Attributes

 $fld_protection = false
 $pageRestrictions
 $params
 $protections
 $tokenFunctions

Detailed Description

A query module to show basic page information.

Definition at line 32 of file ApiQueryInfo.php.


Constructor & Destructor Documentation

ApiQueryInfo::__construct ( query,
moduleName 
)

Definition at line 48 of file ApiQueryInfo.php.


Member Function Documentation

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 231 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().

Here is the call graph for this function:

ApiQueryInfo::extractPageInfo ( pageid,
title 
) [private]

Get a result array with information about a title.

Parameters:
$pageidint Page ID (negative for missing titles)
$titleTitle object
Returns:
array

Definition at line 323 of file ApiQueryInfo.php.

References $t, $title, $tokenFunctions, $wgDisableCounters, ApiBase\getResult(), getTokenFunctions(), ApiBase\setWarning(), wfExpandUrl(), wfRunHooks(), and wfTimestamp().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns:
array or false

Reimplemented from ApiBase.

Definition at line 665 of file ApiQueryInfo.php.

References getTokenFunctions(), ApiBase\PARAM_DFLT, ApiBase\PARAM_ISMULTI, and ApiBase\PARAM_TYPE.

Here is the call graph for this function:

static ApiQueryInfo::getBlockToken ( pageid,
title 
) [static]

Definition at line 166 of file ApiQueryInfo.php.

References $wgUser.

Referenced by getUnblockToken().

Here is the caller graph for this function:

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.

Parameters:
$params
Returns:
string

Reimplemented from ApiQueryBase.

Definition at line 643 of file ApiQueryInfo.php.

References $params.

static ApiQueryInfo::getDeleteToken ( pageid,
title 
) [static]

Definition at line 121 of file ApiQueryInfo.php.

References $wgUser.

Returns the description string for this module.

Returns:
mixed string or array of strings

Reimplemented from ApiBase.

Definition at line 709 of file ApiQueryInfo.php.

Definition at line 592 of file ApiQueryInfo.php.

References $res, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhereFld(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

static ApiQueryInfo::getEditToken ( pageid,
title 
) [static]

Definition at line 102 of file ApiQueryInfo.php.

References $wgUser.

static ApiQueryInfo::getEmailToken ( pageid,
title 
) [static]

Definition at line 186 of file ApiQueryInfo.php.

References $wgUser.

Returns usage examples for this module.

Return false if no examples are available.

Returns:
false|string|array

Reimplemented from ApiBase.

Definition at line 719 of file ApiQueryInfo.php.

Returns:
false|string|array Returns a false if the module has no help url, else returns a (array of) string

Reimplemented from ApiBase.

Definition at line 726 of file ApiQueryInfo.php.

static ApiQueryInfo::getImportToken ( pageid,
title 
) [static]

Definition at line 201 of file ApiQueryInfo.php.

References $wgUser.

static ApiQueryInfo::getMoveToken ( pageid,
title 
) [static]

Definition at line 151 of file ApiQueryInfo.php.

References $wgUser.

Returns an array of parameter descriptions.

Don't call this functon directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.

Returns:
array or false

Reimplemented from ApiBase.

Definition at line 691 of file ApiQueryInfo.php.

Returns:
array

Reimplemented from ApiQueryBase.

Definition at line 713 of file ApiQueryInfo.php.

Get information about protections and put it in $protections.

Definition at line 410 of file ApiQueryInfo.php.

References $lb, $res, $title, $wgContLang, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), ApiQueryBase\addWhereFld(), ApiQueryBase\getDB(), Title\makeTitle(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

static ApiQueryInfo::getProtectToken ( pageid,
title 
) [static]

Definition at line 136 of file ApiQueryInfo.php.

References $wgUser.

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)

Returns:
array array(tokenname => function)

Definition at line 76 of file ApiQueryInfo.php.

References ApiBase\getMain(), ContextSource\getRequest(), and wfRunHooks().

Referenced by extractPageInfo(), and getAllowedParams().

Here is the call graph for this function:

Here is the caller graph for this function:

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 555 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().

Here is the call graph for this function:

Here is the caller graph for this function:

static ApiQueryInfo::getUnblockToken ( pageid,
title 
) [static]

Definition at line 181 of file ApiQueryInfo.php.

References $title, and getBlockToken().

Here is the call graph for this function:

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

Returns:
string

Reimplemented from ApiBase.

Definition at line 730 of file ApiQueryInfo.php.

Get information about watched status and put it in $this->watched.

Definition at line 616 of file ApiQueryInfo.php.

References $lb, $res, $user, ApiQueryBase\addFields(), ApiQueryBase\addTables(), ApiQueryBase\addWhere(), ApiQueryBase\getDB(), ContextSource\getUser(), ApiQueryBase\resetQueryParams(), and ApiQueryBase\select().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

static ApiQueryInfo::getWatchToken ( pageid,
title 
) [static]

Definition at line 216 of file ApiQueryInfo.php.

References $wgUser.

Referenced by ResourceLoaderUserTokensModule\contextUserTokens().

Here is the caller graph for this function:

Parameters:
$pageSetApiPageSet
Returns:
void

Reimplemented from ApiQueryBase.

Definition at line 56 of file ApiQueryInfo.php.

References $wgDisableCounters.


Member Data Documentation

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_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::$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.


The documentation for this class was generated from the following file: