ApiQueryInfo Class Reference
[API]

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

Inherits ApiQueryBase.

List of all members.

Public Member Functions

 __construct ($query, $moduleName)
 requestExtraData ($pageSet)
 Override this method to request extra fields from the pageSet using $pageSet->requestField('fieldName').
 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.
 getParamDescription ()
 Returns an array of parameter descriptions.
 getDescription ()
 Returns the description string for this module.
 getVersion ()
 Returns a string that identifies the version of the extending class.

Static Public Member Functions

static getEditToken ($pageid, $title)
static getDeleteToken ($pageid, $title)
static getProtectToken ($pageid, $title)
static getMoveToken ($pageid, $title)
static getBlockToken ($pageid, $title)
static getUnblockToken ($pageid, $title)
static getEmailToken ($pageid, $title)
static getImportToken ($pageid, $title)

Protected Member Functions

 getTokenFunctions ()
 Get an array mapping token names to their handler functions.
 getExamples ()
 Returns usage examples for this module.

Private Member Functions

 extractPageInfo ($pageid, $title)
 Get a result array with information about a title.
 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.

Private Attributes

 $fld_protection = false
 $fld_talkid = false
 $fld_subjectid = false
 $fld_url = false
 $fld_readable = false


Detailed Description

A query module to show basic page information.

Definition at line 36 of file ApiQueryInfo.php.


Constructor & Destructor Documentation

ApiQueryInfo::__construct ( query,
moduleName 
)

Definition at line 42 of file ApiQueryInfo.php.


Member Function Documentation

ApiQueryInfo::execute (  ) 

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 193 of file ApiQueryInfo.php.

References $db, $result, $title, Title::compare(), ApiBase::dieUsage(), extractPageInfo(), ApiBase::extractRequestParams(), ApiQueryBase::getDB(), ApiQueryBase::getPageSet(), getProtectionInfo(), ApiBase::getResult(), getTSIDs(), Title::makeTitleSafe(), and ApiQueryBase::setContinueEnumParameter().

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

Get a result array with information about a title.

Parameters:
$pageid int Page ID (negative for missing titles)
$title Title object
Returns:
array

Definition at line 269 of file ApiQueryInfo.php.

References $t, $title, ApiBase::getResult(), getTokenFunctions(), ApiBase::setWarning(), and wfTimestamp().

Referenced by execute().

ApiQueryInfo::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.

Returns:
array

Reimplemented from ApiBase.

Definition at line 502 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 145 of file ApiQueryInfo.php.

References $wgUser.

Referenced by getUnblockToken().

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

Definition at line 103 of file ApiQueryInfo.php.

References $wgUser.

ApiQueryInfo::getDescription (  ) 

Returns the description string for this module.

Returns:
mixed string or array of strings

Reimplemented from ApiBase.

Definition at line 536 of file ApiQueryInfo.php.

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

Definition at line 85 of file ApiQueryInfo.php.

References $wgUser.

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

Definition at line 165 of file ApiQueryInfo.php.

References $wgUser.

ApiQueryInfo::getExamples (  )  [protected]

Returns usage examples for this module.

Return null if no examples are available.

Returns:
mixed string or array of strings

Reimplemented from ApiBase.

Definition at line 540 of file ApiQueryInfo.php.

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

Definition at line 179 of file ApiQueryInfo.php.

References $wgUser.

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

Definition at line 131 of file ApiQueryInfo.php.

References $wgUser.

ApiQueryInfo::getParamDescription (  ) 

Returns an array of parameter descriptions.

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

Returns:
array

Reimplemented from ApiBase.

Definition at line 523 of file ApiQueryInfo.php.

ApiQueryInfo::getProtectionInfo (  )  [private]

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

Definition at line 117 of file ApiQueryInfo.php.

References $wgUser.

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)

Returns:
array(tokenname => function)

Definition at line 62 of file ApiQueryInfo.php.

References ApiBase::getMain(), 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 466 of file ApiQueryInfo.php.

References $db, $lb, $res, $row, $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 159 of file ApiQueryInfo.php.

References $title, and getBlockToken().

ApiQueryInfo::getVersion (  ) 

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 547 of file ApiQueryInfo.php.

ApiQueryInfo::requestExtraData ( pageSet  ) 

Override this method to request extra fields from the pageSet using $pageSet->requestField('fieldName').

Parameters:
$pageSet ApiPageSet

Reimplemented from ApiQueryBase.

Definition at line 46 of file ApiQueryInfo.php.


Member Data Documentation

ApiQueryInfo::$fld_protection = false [private]

Definition at line 38 of file ApiQueryInfo.php.

ApiQueryInfo::$fld_readable = false [private]

Definition at line 40 of file ApiQueryInfo.php.

ApiQueryInfo::$fld_subjectid = false [private]

Definition at line 39 of file ApiQueryInfo.php.

ApiQueryInfo::$fld_talkid = false [private]

Definition at line 38 of file ApiQueryInfo.php.

ApiQueryInfo::$fld_url = false [private]

Definition at line 39 of file ApiQueryInfo.php.


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

Generated on Sat Sep 5 02:08:32 2009 for MediaWiki by  doxygen 1.5.9