MediaWiki  master
ApiBase Class Reference

This abstract class implements many basic API functions, and is the base of all API classes. More...

Inheritance diagram for ApiBase:
Collaboration diagram for ApiBase:

Public Member Functions

 __construct (ApiMain $mainModule, $moduleName, $modulePrefix= '')
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getConfig ()
 Get the Config object. More...
 
 getContext ()
 Get the base IContextSource object. More...
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 Get the OutputPage object. More...
 
 getRequest ()
 Get the WebRequest object. More...
 
 getSkin ()
 Get the Skin object. More...
 
 getTitle ()
 Get the Title object. More...
 
 getUser ()
 Get the User object. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 Set the IContextSource object. More...
 

Public Attributes

string $mModulePrefix
 
const GET_VALUES_FOR_HELP = 1
 getAllowedParams() flag: When set, the result could take longer to generate, but should be more thorough. More...
 
const LIMIT_BIG1 = 500
 
const LIMIT_BIG2 = 5000
 
const LIMIT_SML1 = 50
 
const LIMIT_SML2 = 500
 
const PARAM_ALLOW_DUPLICATES = 6
 
const PARAM_DEPRECATED = 7
 
const PARAM_DFLT = 0
 
const PARAM_HELP_MSG = 10
 
const PARAM_HELP_MSG_APPEND = 11
 
const PARAM_HELP_MSG_INFO = 12
 
const PARAM_HELP_MSG_PER_VALUE = 14
 
const PARAM_ISMULTI = 1
 
const PARAM_MAX = 3
 
const PARAM_MAX2 = 4
 
const PARAM_MIN = 5
 
const PARAM_RANGE_ENFORCE = 9
 
const PARAM_REQUIRED = 8
 
const PARAM_TYPE = 2
 
const PARAM_VALUE_LINKS = 13
 

Private Attributes

ApiMain $mMainModule
 
string $mModuleName
 
 $mParamCache = array()
 
 $mSlaveDB = null
 

Methods to implement

 execute ()
 Evaluates the parameters, performs the requested query, and sets up the result. More...
 
 getModuleManager ()
 Get the module manager, or null if this module has no sub-modules. More...
 
 getCustomPrinter ()
 If the module may only be used with a certain format module, it should override this method to return an instance of that formatter. More...
 
 getHelpUrls ()
 Return links to more detailed help pages about the module. More...
 
 shouldCheckMaxlag ()
 Indicates if this module needs maxlag to be checked. More...
 
 isReadMode ()
 Indicates whether this module requires read rights. More...
 
 isWriteMode ()
 Indicates whether this module requires write mode. More...
 
 mustBePosted ()
 Indicates whether this module must be called with a POST request. More...
 
 isDeprecated ()
 Indicates whether this module is deprecated. More...
 
 isInternal ()
 Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party use and may be unstable. More...
 
 needsToken ()
 Returns the token type this module requires in order to execute. More...
 
 getExamplesMessages ()
 Returns usage examples for this module. More...
 
 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. More...
 
 getWebUITokenSalt (array $params)
 Fetch the salt used in the Web UI corresponding to this module. More...
 

Data access methods

 getModuleName ()
 Get the name of the module being executed by this instance. More...
 
 getModulePrefix ()
 Get parameter prefix (usually two letters or an empty string). More...
 
 getMain ()
 Get the main module. More...
 
 isMain ()
 Returns true if this module is the main module ($this === $this->mMainModule), false otherwise. More...
 
 getParent ()
 Get the parent of this module. More...
 
 lacksSameOriginSecurity ()
 Returns true if the current request breaks the same-origin policy. More...
 
 getModulePath ()
 Get the path to this module. More...
 
 getModuleFromPath ($path)
 Get a module from its module path. More...
 
 getResult ()
 Get the result object. More...
 
 getResultData ()
 Get the result data array (read-only) More...
 
 getDB ()
 Gets a default slave database connection object. More...
 

Parameter handling

 encodeParamName ($paramName)
 This method mangles parameter name based on the prefix supplied to the constructor. More...
 
 extractRequestParams ($parseLimit=true)
 Using getAllowedParams(), this function makes an array of the values provided by the user, with key being the name of the variable, and value - validated value from user or default. More...
 
 requireOnlyOneParameter ($params, $required)
 Die if none or more than one of a certain set of parameters is set and not false. More...
 
 requireMaxOneParameter ($params, $required)
 Die if more than one of a certain set of parameters is set and not false. More...
 
 requireAtLeastOneParameter ($params, $required)
 Die if none of a certain set of parameters is set and not false. More...
 
 getTitleOrPageId ($params, $load=false)
 Get a WikiPage object from a title or pageid param, if possible. More...
 
 validateToken ($token, array $params)
 Validate the supplied token. More...
 
 getParameter ($paramName, $parseLimit=true)
 Get a value for the given parameter. More...
 
 getWatchlistValue ($watchlist, $titleObj, $userOption=null)
 Return true if we're to watch the page, false if not, null if no change. More...
 
 getParameterFromSettings ($paramName, $paramSettings, $parseLimit)
 Using the settings determine the value for the given parameter. More...
 
 parseMultiValue ($valueName, $value, $allowMultiple, $allowedValues)
 Return an array of values that were given in a 'a|b|c' notation, after it optionally validates them against the list allowed values. More...
 
 validateLimit ($paramName, &$value, $min, $max, $botMax=null, $enforceLimits=false)
 Validate the value against the minimum and user/bot maximum limits. More...
 
 validateTimestamp ($value, $encParamName)
 Validate and normalize of parameters of type 'timestamp'. More...
 
 parameterNotEmpty ($x)
 Callback function used in requireOnlyOneParameter to check whether required parameters are set. More...
 
 validateUser ($value, $encParamName)
 Validate and normalize of parameters of type 'user'. More...
 

Utility methods

 getWatchlistUser ($params)
 Gets the user for whom to get the watchlist. More...
 
 setWatch ($watch, $titleObj, $userOption=null)
 Set a watch (or unwatch) based the based on a watchlist parameter. More...
 
static truncateArray (&$arr, $limit)
 Truncate an array to a certain length. More...
 
static makeMessage ($msg, IContextSource $context, array $params=null)
 Create a Message from a string or array. More...
 
static escapeWikiText ($v)
 A subset of wfEscapeWikiText for BC texts. More...
 

Warning and error reporting

static $messageMap
 Array that maps message keys to error messages. More...
 
 setWarning ($warning)
 Set warning section for this module. More...
 
 dieUsage ($description, $errorCode, $httpRespCode=0, $extradata=null)
 Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an error message. More...
 
 getErrorFromStatus ($status)
 Get error (as code, string) from a Status object. More...
 
 dieStatus ($status)
 Throw a UsageException based on the errors in the Status object. More...
 
 dieReadOnly ()
 Helper function for readonly errors. More...
 
 dieUsageMsg ($error)
 Output the error message related to a certain array. More...
 
 dieUsageMsgOrDebug ($error)
 Will only set a warning instead of failing if the global $wgDebugAPI is set to true. More...
 
 parseMsg ($error)
 Return the error message related to a certain array. More...
 
 dieContinueUsageIf ($condition)
 Die with the $prefix. More...
 
 warnOrDie ($msg, $enforceLimits=false)
 Adds a warning to the output, else dies. More...
 
static dieDebug ($method, $message)
 Internal code errors should be reported with this method. More...
 

Help message generation

 getFinalDescription ()
 Get final module description, after hooks have had a chance to tweak it as needed. More...
 
 getFinalParams ($flags=0)
 Get final list of parameters, after hooks have had a chance to tweak it as needed. More...
 
 getFinalParamDescription ()
 Get final parameter descriptions, after hooks have had a chance to tweak it as needed. More...
 
 modifyHelp (array &$help, array $options)
 Called from ApiHelp before the pieces are joined together and returned. More...
 
 getDescriptionMessage ()
 Return the description message. More...
 
 getHelpFlags ()
 Generates the list of flags for the help screen and for action=paraminfo. More...
 

Profiling

 $mModuleTime = 0
 Profiling: total module execution time. More...
 
 $mDBTime = 0
 Profiling: total module execution time. More...
 
 $mTimeIn = 0
 Profiling: total module execution time. More...
 
ScopedCallback $profile
 Profiling: total module execution time. More...
 
ScopedCallback $dbProfile
 Profiling: total module execution time. More...
 
 $mDBTimeIn = 0
 Profiling: database execution time. More...
 
 getModuleProfileName ($db=false)
 Get the name of the module as shown in the profiler log. More...
 
 profileIn ()
 Start module profiling. More...
 
 profileOut ()
 End module profiling. More...
 
 safeProfileOut ()
 When modules crash, sometimes it is needed to do a profileOut() regardless of the profiling state the module was in. More...
 
 getProfileTime ()
 Total time the module was executed. More...
 
 profileDBIn ()
 Start module profiling. More...
 
 profileDBOut ()
 End database profiling. More...
 
 getProfileDBTime ()
 Total time the module used the database. More...
 
 logFeatureUsage ($feature)
 Write logging information for API features to a debug log, for usage analysis. More...
 

Deprecated

const PROP_ROOT = 'ROOT'
 
const PROP_LIST = 'LIST'
 
const PROP_TYPE = 0
 
const PROP_NULLABLE = 1
 
 getVersion ()
 Formerly returned a string that identifies the version of the extending class. More...
 
 getFinalResultProperties ()
 
 getRequireOnlyOneParameterErrorMessages ($params)
 
 getRequireMaxOneParameterErrorMessages ($params)
 
 getRequireAtLeastOneParameterErrorMessages ($params)
 
 getTitleOrPageIdErrorMessage ()
 
 getPossibleErrors ()
 This formerly attempted to return a list of all possible errors returned by the module. More...
 
 getFinalPossibleErrors ()
 
 parseErrors ($errors)
 
 makeHelpMsg ()
 Generates help message for this module, or false if there is no description. More...
 
 makeHelpMsgParameters ()
 Generates the parameter descriptions for this module, to be displayed in the module's help. More...
 
 getResultProperties ()
 Formerly used to fetch a list of possible properites in the result, somehow organized with respect to the prop parameter that causes them to be returned. More...
 
 getDescription ()
 Returns the description string for this module. More...
 
 getParamDescription ()
 Returns an array of parameter descriptions. More...
 
 getExamples ()
 Returns usage examples for this module. More...
 
 makeHelpArrayToString ($prefix, $title, $input)
 
 indentExampleText ($item)
 
static addTokenProperties (&$props, $tokenFunctions)
 

Detailed Description

This abstract class implements many basic API functions, and is the base of all API classes.

The class functions are divided into several areas of functionality:

Module parameters: Derived classes can define getAllowedParams() to specify which parameters to expect, how to parse and validate them.

Profiling: various methods to allow keeping tabs on various tasks and their time costs

Self-documentation: code to allow the API to document its own state

Definition at line 42 of file ApiBase.php.

Constructor & Destructor Documentation

ApiBase::__construct ( ApiMain  $mainModule,
  $moduleName,
  $modulePrefix = '' 
)
Parameters
ApiMain$mainModule
string$moduleNameName of this module
string$modulePrefixPrefix to use for parameter names

Definition at line 114 of file ApiBase.php.

References ContextSource\getContext(), isMain(), and ContextSource\setContext().

Member Function Documentation

static ApiBase::addTokenProperties ( $props,
  $tokenFunctions 
)
staticprotected
See Also
self::getResultProperties()
Deprecated:
since 1.24

Definition at line 2400 of file ApiBase.php.

References wfDeprecated().

ApiBase::dieReadOnly ( )

Helper function for readonly errors.

Definition at line 1866 of file ApiBase.php.

References array(), dieUsage(), parseMsg(), and wfReadOnlyReason().

Referenced by ApiMain\checkExecutePermissions(), and ApiEditPage\execute().

ApiBase::dieStatus (   $status)
ApiBase::dieUsage (   $description,
  $errorCode,
  $httpRespCode = 0,
  $extradata = null 
)

Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an error message.

Parameters
string$descriptionOne-line human-readable description of the error condition, e.g., "The API requires a valid action parameter"
string$errorCodeBrief, arbitrary, stable string to allow easy automated identification of the error, e.g., 'unknown_action'
int$httpRespCodeHTTP response code
array$extradataData to add to the "<error>" element; array in ApiResult format
Exceptions
UsageException

Definition at line 1297 of file ApiBase.php.

References encodeParamName(), and Profiler\instance().

Referenced by ApiQuerySiteinfo\appendDbReplLagInfo(), ApiMain\checkAsserts(), ApiUpload\checkAsyncDownloadEnabled(), ApiMain\checkMaxLag(), ApiQueryImageInfo\checkParameterNormalise(), ApiUpload\checkVerification(), ApiMain\createPrinterByName(), dieContinueUsageIf(), dieReadOnly(), ApiUpload\dieRecoverableError(), dieStatus(), dieUsageMsg(), ApiComparePages\execute(), ApiManageTags\execute(), ApiCreateAccount\execute(), ApiRevisionDelete\execute(), ApiQueryStashImageInfo\execute(), ApiUpload\execute(), ApiEditPage\execute(), ApiWatch\execute(), ApiSetNotificationTimestamp\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiExpandTemplates\execute(), ApiStashEdit\execute(), ApiOptions\execute(), ApiFormatPhp\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiDisabled\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryAllUsers\execute(), ApiFeedWatchlist\execute(), ApiQueryAllPages\executeGenerator(), ApiQueryAllImages\executeGenerator(), ApiPageSet\executeInternal(), ApiQueryRevisionsBase\extractRevisionInfo(), ApiUpload\getChunkResult(), getModuleFromPath(), getParameterFromSettings(), ApiParse\getParsedContent(), ApiParse\getSectionContent(), ApiUpload\getStashResult(), getTitleOrPageId(), getWatchlistUser(), ApiUpload\handleStashException(), ApiQueryImageInfo\mergeThumbParams(), ApiQuery\outputGeneralPageInfo(), parseMultiValue(), ApiQueryRevisionsBase\parseParameters(), ApiUpload\performUpload(), ApiQueryContributions\prepareQuery(), ApiQueryBase\prepareUrlQuerySearchString(), ApiQueryContributions\prepareUsername(), ApiQueryBlocks\prepareUsername(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireOnlyOneParameter(), ApiComparePages\revisionOrTitleOrId(), ApiQueryDeletedRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryWatchlist\run(), ApiQuerySearch\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ApiUpload\selectUploadModule(), ApiMain\setupExecuteAction(), ApiMain\setupModule(), validateTimestamp(), validateUser(), and warnOrDie().

ApiBase::dieUsageMsg (   $error)

Output the error message related to a certain array.

Parameters
array | string$errorElement of a getUserPermissionsErrors()-style array

Definition at line 1876 of file ApiBase.php.

References array(), dieUsage(), and parseMsg().

Referenced by ApiMain\checkExecutePermissions(), ApiFileRevert\checkPermissions(), ApiUpload\checkPermissions(), dieUsageMsgOrDebug(), ApiProtect\execute(), ApiCreateAccount\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiImport\execute(), ApiEditPage\execute(), ApiUpload\execute(), ApiWatch\execute(), ApiParse\execute(), ApiExpandTemplates\execute(), ApiPatrol\execute(), ApiOptions\execute(), ApiQueryLangLinks\execute(), ApiUnblock\execute(), ApiRollback\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiQueryIWLinks\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiFeedRecentChanges\getFeedObject(), getParameterFromSettings(), ApiRollback\getRbTitle(), ApiRollback\getRbUser(), getTitleOrPageId(), ApiQueryBase\keyToTitle(), ApiQueryRevisionsBase\parseParameters(), ApiQueryContributions\prepareQuery(), ApiComparePages\revisionOrTitleOrId(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategories\run(), ApiQueryWatchlist\run(), ApiQueryQueryPage\run(), ApiQueryBacklinksprop\run(), ApiQueryRecentChanges\run(), ApiUpload\selectUploadModule(), ApiMain\setupModule(), ApiQueryBase\titlePartToKey(), ApiQueryBase\titleToKey(), and ApiFileRevert\validateParameters().

ApiBase::dieUsageMsgOrDebug (   $error)

Will only set a warning instead of failing if the global $wgDebugAPI is set to true.

Otherwise behaves exactly as dieUsageMsg().

Parameters
array | string$errorElement of a getUserPermissionsErrors()-style array
Since
1.21

Definition at line 1892 of file ApiBase.php.

References array(), dieUsageMsg(), ContextSource\getConfig(), parseMsg(), and setWarning().

Referenced by ApiQuery\instantiateModules(), and ApiMain\setupExternalResponse().

ApiBase::encodeParamName (   $paramName)

This method mangles parameter name based on the prefix supplied to the constructor.

Override this method to change parameter name during runtime

Parameters
string$paramNameParameter name
Returns
string Prefixed parameter name

Definition at line 505 of file ApiBase.php.

Referenced by dieUsage(), ApiQueryLogEvents\execute(), getParameterFromSettings(), makeHelpMsgParameters(), ApiResult\setContinueParam(), ApiResult\setGeneratorContinueParam(), and validateLimit().

static ApiBase::escapeWikiText (   $v)
staticprivate

A subset of wfEscapeWikiText for BC texts.

Since
1.25
Parameters
string | array$v
Returns
string|array

Definition at line 1190 of file ApiBase.php.

References array().

ApiBase::execute ( )
abstract

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

ApiBase::extractRequestParams (   $parseLimit = true)

Using getAllowedParams(), this function makes an array of the values provided by the user, with key being the name of the variable, and value - validated value from user or default.

limits will not be parsed if $parseLimit is set to false; use this when the max limit is not definitive yet, e.g. when getting revisions.

Parameters
bool$parseLimitTrue by default
Returns
array

Definition at line 518 of file ApiBase.php.

References $params, array(), as, getFinalParams(), and getParameterFromSettings().

Referenced by ApiPageSet\__construct(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendLanguages(), ApiManageTags\execute(), ApiComparePages\execute(), ApiCreateAccount\execute(), ApiCheckToken\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiTokens\execute(), ApiEmailUser\execute(), ApiImport\execute(), ApiHelp\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiUpload\execute(), ApiWatch\execute(), ApiEditPage\execute(), ApiExpandTemplates\execute(), ApiQueryTokens\execute(), ApiSetNotificationTimestamp\execute(), ApiStashEdit\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiFileRevert\execute(), ApiOptions\execute(), ApiPurge\execute(), ApiQuerySiteinfo\execute(), ApiQueryAllMessages\execute(), ApiQueryTags\execute(), ApiQueryBlocks\execute(), ApiUnblock\execute(), ApiRollback\execute(), ApiQueryExternalLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryDeletedrevs\execute(), ApiParamInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryPageProps\execute(), ApiQueryFilearchive\execute(), ApiBlock\execute(), ApiFeedContributions\execute(), ApiDelete\execute(), ApiQueryUserInfo\execute(), ApiFeedRecentChanges\execute(), ApiQueryPagePropNames\execute(), ApiQueryContributions\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryImageInfo\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiLogin\execute(), ApiFormatXml\execute(), ApiImageRotate\execute(), ApiUserrights\execute(), ApiFeedWatchlist\execute(), ApiFormatJson\execute(), ApiOpenSearch\execute(), ApiQueryUsers\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getFormat(), ApiFormatJson\getMimeType(), ApiQueryORM\getParams(), ApiQueryDeletedRevisions\run(), ApiQueryPrefixSearch\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryQueryPage\run(), ApiQuerySearch\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), and ApiMain\setupExecuteAction().

ApiBase::getAllowedParams ( )
protected

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.

Returns
array

Definition at line 243 of file ApiBase.php.

References array().

Referenced by getFinalParams().

ApiBase::getCustomPrinter ( )

If the module may only be used with a certain format module, it should override this method to return an instance of that formatter.

A value of null means the default format will be used.

Note
Do not use this just because you don't want to support non-json formats. This should be used only when there is a fundamental requirement for a specific format.
Returns
mixed Instance of a derived class of ApiFormatBase, or null

Definition at line 166 of file ApiBase.php.

ApiBase::getDB ( )
protected

Gets a default slave database connection object.

Returns
DatabaseBase

Definition at line 482 of file ApiBase.php.

References $mSlaveDB, DB_SLAVE, profileDBIn(), profileDBOut(), and wfGetDB().

Referenced by ApiQuery\doExport(), ApiProtect\execute(), ApiBlock\execute(), and ApiParse\formatCategoryLinks().

ApiBase::getDescription ( )
protected

Returns the description string for this module.

Ignored if an i18n message exists for "apihelp-{$this->getModulePathString()}-description".

Deprecated:
since 1.25
Returns
Message|string|array

Definition at line 2488 of file ApiBase.php.

Referenced by getFinalDescription().

ApiBase::getDescriptionMessage ( )
protected

Return the description message.

Returns
string|array|Message

Definition at line 1967 of file ApiBase.php.

Referenced by getFinalDescription().

ApiBase::getErrorFromStatus (   $status)

Get error (as code, string) from a Status object.

Since
1.23
Parameters
Status$status
Returns
array Array of code and error string
Exceptions
MWException

Definition at line 1315 of file ApiBase.php.

References $messageMap, $status, array(), and wfMessage().

Referenced by dieStatus(), ApiMove\execute(), and ApiWatch\watchTitle().

ApiBase::getExamples ( )
protected

Returns usage examples for this module.

Return value as an array is either:

  • numeric keys with partial URLs ("api.php?" plus a query string) as values
  • sequential numeric keys with even-numbered keys being display-text and odd-numbered keys being partial urls
  • partial URLs as keys with display-text (string or array-to-be-joined) as values Return value as a string is the same as an array with a numeric key and that value, and boolean false means "no examples".
Deprecated:
since 1.25, use getExamplesMessages() instead
Returns
bool|string|array

Definition at line 2524 of file ApiBase.php.

Referenced by getExamplesMessages(), and makeHelpMsg().

ApiBase::getExamplesMessages ( )
protected

Returns usage examples for this module.

Return value has query strings as keys, with values being either strings (message key), arrays (message key + parameter), or Message objects.

Do not call this base class implementation when overriding this method.

Since
1.25
Returns
array

Definition at line 181 of file ApiBase.php.

References $ret, array(), as, getExamples(), and ContextSource\msg().

ApiBase::getFinalDescription ( )

Get final module description, after hooks have had a chance to tweak it as needed.

Since
1.25, returns Message[] rather than string[]
Returns
Message[]

Definition at line 1978 of file ApiBase.php.

References array(), ContextSource\getContext(), getDescription(), getDescriptionMessage(), getModuleName(), getModulePath(), getModulePrefix(), makeMessage(), ContextSource\msg(), and Hooks\run().

Referenced by makeHelpMsg().

ApiBase::getFinalParamDescription ( )

Get final parameter descriptions, after hooks have had a chance to tweak it as needed.

Since
1.25, returns array of Message[] rather than array of string[]
Returns
array Keys are parameter names, values are arrays of Message objects

Definition at line 2040 of file ApiBase.php.

References $line, $name, $params, $path, $value, array(), as, dieDebug(), GET_VALUES_FOR_HELP, ContextSource\getContext(), getFinalParams(), getModuleName(), getModulePath(), getModulePrefix(), getParamDescription(), makeMessage(), ContextSource\msg(), PARAM_HELP_MSG, PARAM_HELP_MSG_APPEND, PARAM_HELP_MSG_PER_VALUE, PARAM_TYPE, Hooks\run(), and Message\setContext().

Referenced by makeHelpMsgParameters().

ApiBase::getFinalParams (   $flags = 0)

Get final list of parameters, after hooks have had a chance to tweak it as needed.

Parameters
int$flagsZero or more flags like GET_VALUES_FOR_HELP
Returns
array|bool False on no parameters
Since
1.21 $flags param added

Definition at line 2011 of file ApiBase.php.

References $flags, $params, array(), getAllowedParams(), needsToken(), PARAM_HELP_MSG, PARAM_REQUIRED, PARAM_TYPE, and Hooks\run().

Referenced by extractRequestParams(), getFinalParamDescription(), getParameter(), and makeHelpMsgParameters().

ApiBase::getFinalPossibleErrors ( )
See Also
self::getPossibleErrors()
Deprecated:
since 1.24
Returns
array

Definition at line 2464 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getFinalResultProperties ( )
See Also
self::getResultProperties()
Deprecated:
since 1.24
Returns
array|bool

Definition at line 2391 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getHelpFlags ( )
protected

Generates the list of flags for the help screen and for action=paraminfo.

Corresponding messages: api-help-flag-deprecated, api-help-flag-internal, api-help-flag-readrights, api-help-flag-writerights, api-help-flag-mustbeposted

Returns
string[]

Definition at line 2154 of file ApiBase.php.

References $flags, array(), isDeprecated(), isInternal(), isReadMode(), isWriteMode(), and mustBePosted().

ApiBase::getHelpUrls ( )

Return links to more detailed help pages about the module.

Since
1.25, returning boolean false is deprecated
Returns
string|array

Definition at line 227 of file ApiBase.php.

References array().

Referenced by makeHelpMsg().

ApiBase::getModuleFromPath (   $path)

Get a module from its module path.

Since
1.25
Parameters
string$path
Returns
ApiBase|null
Exceptions
UsageException

Definition at line 422 of file ApiBase.php.

References $count, $path, dieUsage(), and getMain().

Referenced by ApiHelp\execute(), and ApiParamInfo\execute().

ApiBase::getModuleManager ( )

Get the module manager, or null if this module has no sub-modules.

Since
1.21
Returns
ApiModuleManager

Definition at line 153 of file ApiBase.php.

Referenced by ApiParamInfo\execute(), getParameterFromSettings(), and makeHelpMsgParameters().

ApiBase::getModuleName ( )

Get the name of the module being executed by this instance.

Returns
string

Definition at line 346 of file ApiBase.php.

References $mModuleName.

Referenced by ApiPageSet\__construct(), ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiManageTags\execute(), ApiComparePages\execute(), ApiClearHasMsg\execute(), ApiCheckToken\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiTokens\execute(), ApiMove\execute(), ApiEmailUser\execute(), ApiHelp\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiImport\execute(), ApiUpload\execute(), ApiEditPage\execute(), ApiWatch\execute(), ApiQueryTokens\execute(), ApiStashEdit\execute(), ApiSetNotificationTimestamp\execute(), ApiExpandTemplates\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiOptions\execute(), ApiFileRevert\execute(), ApiQueryTags\execute(), ApiQueryAllMessages\execute(), ApiRollback\execute(), ApiQueryBlocks\execute(), ApiUnblock\execute(), ApiPurge\execute(), ApiQueryDeletedrevs\execute(), ApiParamInfo\execute(), ApiQueryFilearchive\execute(), ApiDelete\execute(), ApiBlock\execute(), ApiQueryUserInfo\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryAllUsers\execute(), ApiUserrights\execute(), ApiImageRotate\execute(), ApiQueryUsers\execute(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLinks\getExamplesMessages(), ApiFormatBase\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), getFinalDescription(), getFinalParamDescription(), ApiQueryAllLinks\getHelpUrls(), ApiQueryBacklinksprop\getHelpUrls(), getModulePath(), getParameterFromSettings(), ApiMain\makeHelpMsg(), ApiFormatBase\markDeprecated(), ApiQueryRevisionsBase\parseParameters(), ApiQueryPrefixSearch\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQuerySearch\run(), ApiQueryQueryPage\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), ApiUpload\selectUploadModule(), ApiResult\setContinueParam(), ApiResult\setGeneratorContinueParam(), and setWarning().

ApiBase::getModulePath ( )
ApiBase::getModuleProfileName (   $db = false)

Get the name of the module as shown in the profiler log.

Parameters
DatabaseBase | bool$db
Returns
string

Definition at line 2209 of file ApiBase.php.

References $mModuleName.

Referenced by profileDBIn(), and profileIn().

ApiBase::getParamDescription ( )
protected

Returns an array of parameter descriptions.

For each parameter, ignored if an i18n message exists for the parameter. By default that message is "apihelp-{$this->getModulePathString()}-param-{$param}", but it may be overridden using ApiBase::PARAM_HELP_MSG in the data returned by self::getFinalParams().

Deprecated:
since 1.25
Returns
array|bool False on no parameter descriptions

Definition at line 2504 of file ApiBase.php.

References array().

Referenced by getFinalParamDescription().

ApiBase::getParameterFromSettings (   $paramName,
  $paramSettings,
  $parseLimit 
)
protected

Using the settings determine the value for the given parameter.

Parameters
string$paramNameParameter name
array | mixed$paramSettingsDefault value or an array of settings using PARAM_* constants.
bool$parseLimitParse limit?
Returns
mixed Parameter value

Definition at line 720 of file ApiBase.php.

References $key, $type, $value, array(), as, dieDebug(), dieUsage(), dieUsageMsg(), encodeParamName(), getMain(), getModuleManager(), getModuleName(), getResult(), MWNamespace\getValidNamespaces(), parseMultiValue(), setWarning(), validateLimit(), validateTimestamp(), and validateUser().

Referenced by extractRequestParams(), and getParameter().

ApiBase::getParent ( )

Get the parent of this module.

Since
1.25
Returns
ApiBase|null

Definition at line 380 of file ApiBase.php.

References getMain(), and isMain().

Referenced by getModulePath().

ApiBase::getPossibleErrors ( )

This formerly attempted to return a list of all possible errors returned by the module.

However, this was impossible to maintain in many cases since errors could come from other areas of MediaWiki and in some cases from arbitrary extension hooks. Since a partial list claiming to be comprehensive is unlikely to be useful, it was removed.

Deprecated:
since 1.24
Returns
array

Definition at line 2454 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getProfileDBTime ( )

Total time the module used the database.

Returns
float

Definition at line 2319 of file ApiBase.php.

References $mDBTime, and dieDebug().

ApiBase::getProfileTime ( )

Total time the module was executed.

Returns
float

Definition at line 2264 of file ApiBase.php.

References $mModuleTime, and dieDebug().

ApiBase::getRequireAtLeastOneParameterErrorMessages (   $params)
See Also
self::getPossibleErrors()
Deprecated:
since 1.24
Returns
array

Definition at line 2429 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getRequireMaxOneParameterErrorMessages (   $params)
See Also
self::getPossibleErrors()
Deprecated:
since 1.24
Returns
array

Definition at line 2419 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getRequireOnlyOneParameterErrorMessages (   $params)
See Also
self::getPossibleErrors()
Deprecated:
since 1.24
Returns
array

Definition at line 2409 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getResult ( )

Get the result object.

Returns
ApiResult

Definition at line 460 of file ApiBase.php.

References dieDebug(), getMain(), and isMain().

Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryORM\addSerializedResults(), ApiQuerySiteinfo\appendDbReplLagInfo(), ApiQuerySiteinfo\appendDefaultOptions(), ApiQuerySiteinfo\appendExtensions(), ApiQuerySiteinfo\appendExtensionTags(), ApiQuerySiteinfo\appendFileExtensions(), ApiQuerySiteinfo\appendFunctionHooks(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendInstalledLibraries(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendLanguages(), ApiQuerySiteinfo\appendMagicWords(), ApiQuerySiteinfo\appendNamespaceAliases(), ApiQuerySiteinfo\appendNamespaces(), ApiQuerySiteinfo\appendProtocols(), ApiQuerySiteinfo\appendRestrictions(), ApiQuerySiteinfo\appendRightsInfo(), ApiQuerySiteinfo\appendSkins(), ApiQuerySiteinfo\appendSpecialPageAliases(), ApiQuerySiteinfo\appendStatistics(), ApiQuerySiteinfo\appendSubscribedHooks(), ApiQuerySiteinfo\appendUserGroups(), ApiQuerySiteinfo\appendVariables(), ApiUpload\checkVerification(), ApiComparePages\execute(), ApiManageTags\execute(), ApiProtect\execute(), ApiCreateAccount\execute(), ApiCheckToken\execute(), ApiClearHasMsg\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiMove\execute(), ApiTokens\execute(), ApiHelp\execute(), ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiRsd\execute(), ApiWatch\execute(), ApiEditPage\execute(), ApiUpload\execute(), ApiStashEdit\execute(), ApiExpandTemplates\execute(), ApiQueryTokens\execute(), ApiParse\execute(), ApiSetNotificationTimestamp\execute(), ApiPatrol\execute(), ApiFileRevert\execute(), ApiOptions\execute(), ApiPurge\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiQueryTags\execute(), ApiRollback\execute(), ApiUnblock\execute(), ApiParamInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryPageProps\execute(), ApiQueryFilearchive\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiQueryUserInfo\execute(), ApiQueryPagePropNames\execute(), ApiQueryLogEvents\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryContributions\execute(), ApiQueryImageInfo\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiLogin\execute(), ApiImageRotate\execute(), ApiUserrights\execute(), ApiFeedWatchlist\execute(), ApiQueryUsers\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiQueryInfo\extractPageInfo(), ApiQueryRevisionsBase\extractRevisionInfo(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiRevisionDelete\extractStatusInfo(), ApiParamInfo\formatHelpMessages(), ApiParse\formatLimitReportData(), ApiRsd\formatRsdApiList(), ApiRevisionDelete\formatStatusMessages(), ApiQueryUserInfo\getCurrentUserInfo(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), getResultData(), ApiQuery\outputGeneralPageInfo(), ApiQueryRevisionsBase\parseParameters(), ApiUpload\performUpload(), ApiOpenSearch\populateResult(), ApiQueryDeletedRevisions\run(), ApiQueryPrefixSearch\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQuerySearch\run(), ApiQueryQueryPage\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), ApiUpload\selectUploadModule(), ApiQueryBase\setContinueEnumParameter(), ApiQueryGeneratorBase\setContinueEnumParameter(), ApiQuery\setGeneratorContinue(), ApiQueryORM\setIndexedTagNames(), ApiParse\setIndexedTagNames(), setWarning(), and ApiUpload\transformWarnings().

ApiBase::getResultProperties ( )
protected

Formerly used to fetch a list of possible properites in the result, somehow organized with respect to the prop parameter that causes them to be returned.

The specific semantics of the return value was never specified. Since this was never possible to be accurately updated, it has been removed.

Deprecated:
since 1.24
Returns
array|bool

Definition at line 2381 of file ApiBase.php.

References wfDeprecated().

ApiBase::getTitleOrPageId (   $params,
  $load = false 
)

Get a WikiPage object from a title or pageid param, if possible.

Can die, if no param is set or if the title or page id is not valid.

Parameters
array$params
bool | string$loadWhether load the object's state from the database:
  • false: don't load (if the pageid is given, it will still be loaded)
  • 'fromdb': load from a slave database
  • 'fromdbmaster': load from the master database
Returns
WikiPage

Definition at line 641 of file ApiBase.php.

References $params, array(), dieUsage(), dieUsageMsg(), WikiPage\factory(), WikiPage\newFromID(), Title\newFromText(), and requireOnlyOneParameter().

Referenced by ApiProtect\execute(), ApiEditPage\execute(), ApiStashEdit\execute(), ApiParse\execute(), ApiDelete\execute(), and ApiQueryCategoryMembers\run().

ApiBase::getTitleOrPageIdErrorMessage ( )
See Also
self::getPossibleErrors()
Deprecated:
since 1.24
Returns
array

Definition at line 2439 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::getVersion ( )

Formerly returned a string that identifies the version of the extending class.

Typically included the class name, the svn revision, timestamp, and last author. Usually done with SVN's Id keyword

Deprecated:
since 1.21, version string is no longer supported
Returns
string

Definition at line 2366 of file ApiBase.php.

References wfDeprecated().

ApiBase::getWatchlistUser (   $params)

Gets the user for whom to get the watchlist.

Parameters
array$params
Returns
User

Definition at line 1157 of file ApiBase.php.

References $params, $user, dieUsage(), ContextSource\getUser(), and User\newFromName().

Referenced by ApiQueryWatchlistRaw\run(), and ApiQueryWatchlist\run().

ApiBase::getWatchlistValue (   $watchlist,
  $titleObj,
  $userOption = null 
)
protected

Return true if we're to watch the page, false if not, null if no change.

Parameters
string$watchlistValid values: 'watch', 'unwatch', 'preferences', 'nochange'
Title$titleObjThe page under consideration
string$userOptionThe user option to consider when $watchlist=preferences. If not set will use watchdefault always and watchcreations if $titleObj doesn't exist.
Returns
bool

Definition at line 678 of file ApiBase.php.

References ContextSource\getUser(), and WatchedItem\IGNORE_USER_RIGHTS.

Referenced by ApiEditPage\execute(), ApiUpload\performUpload(), and setWatch().

ApiBase::getWebUITokenSalt ( array  $params)
protected

Fetch the salt used in the Web UI corresponding to this module.

Only override this if the Web UI uses a token with a non-constant salt.

Since
1.24
Parameters
array$paramsAll supplied parameters for the module
Returns
string|array|null

Definition at line 331 of file ApiBase.php.

Referenced by validateToken().

ApiBase::indentExampleText (   $item)
private
Deprecated:
since 1.25
Parameters
string$item
Returns
string

Definition at line 2603 of file ApiBase.php.

ApiBase::isDeprecated ( )

Indicates whether this module is deprecated.

Since
1.25
Returns
bool

Definition at line 286 of file ApiBase.php.

Referenced by getHelpFlags().

ApiBase::isInternal ( )

Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party use and may be unstable.

Since
1.25
Returns
bool

Definition at line 296 of file ApiBase.php.

Referenced by getHelpFlags().

ApiBase::isMain ( )

Returns true if this module is the main module ($this === $this->mMainModule), false otherwise.

Returns
bool

Definition at line 371 of file ApiBase.php.

References $mMainModule.

Referenced by __construct(), getModulePath(), getParent(), and getResult().

ApiBase::isReadMode ( )

Indicates whether this module requires read rights.

Returns
bool

Definition at line 261 of file ApiBase.php.

Referenced by getHelpFlags(), and makeHelpMsg().

ApiBase::isWriteMode ( )

Indicates whether this module requires write mode.

Returns
bool

Definition at line 269 of file ApiBase.php.

Referenced by getHelpFlags(), and makeHelpMsg().

ApiBase::makeHelpArrayToString (   $prefix,
  $title,
  $input 
)
protected
Deprecated:
since 1.25
Parameters
string$prefixText to split output items
string$titleWhat is being output
string | array$input
Returns
string

Definition at line 2614 of file ApiBase.php.

References $title, array(), and wfDeprecated().

Referenced by makeHelpMsg().

ApiBase::makeHelpMsg ( )

Generates help message for this module, or false if there is no description.

Deprecated:
since 1.25
Returns
string|bool

Definition at line 2533 of file ApiBase.php.

References array(), as, getExamples(), getFinalDescription(), getHelpUrls(), isReadMode(), isWriteMode(), makeHelpArrayToString(), makeHelpMsgParameters(), mustBePosted(), and wfDeprecated().

ApiBase::makeHelpMsgParameters ( )

Generates the parameter descriptions for this module, to be displayed in the module's help.

Deprecated:
since 1.25
Returns
string|bool

Definition at line 2643 of file ApiBase.php.

References $params, $s, $t, $type, array(), as, encodeParamName(), GET_VALUES_FOR_HELP, getFinalParamDescription(), getFinalParams(), getModuleManager(), MWNamespace\getValidNamespaces(), PARAM_DFLT, PARAM_TYPE, and wfDeprecated().

Referenced by makeHelpMsg().

static ApiBase::makeMessage (   $msg,
IContextSource  $context,
array  $params = null 
)
static

Create a Message from a string or array.

A string is used as a message key. An array has the message key as the first value and message parameters as subsequent values.

Since
1.25
Parameters
string | array | Message$msg
IContextSource$context
array$params
Returns
Message|null

Definition at line 1214 of file ApiBase.php.

References $params, and wfMessage().

Referenced by getFinalDescription(), getFinalParamDescription(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().

ApiBase::modifyHelp ( array $help,
array  $options 
)

Called from ApiHelp before the pieces are joined together and returned.

This exists mainly for ApiMain to add the Permissions and Credits sections. Other modules probably don't need it.

Parameters
string[]&$help Array of help data
array$optionsOptions passed to ApiHelp::getHelp

Definition at line 2185 of file ApiBase.php.

ApiBase::mustBePosted ( )

Indicates whether this module must be called with a POST request.

Returns
bool

Definition at line 277 of file ApiBase.php.

References needsToken().

Referenced by getHelpFlags(), and makeHelpMsg().

ApiBase::needsToken ( )

Returns the token type this module requires in order to execute.

Modules are strongly encouraged to use the core 'csrf' type unless they have specialized security needs. If the token type is not one of the core types, you must use the ApiQueryTokensRegisterTypes hook to register it.

Returning a non-falsey value here will force the addition of an appropriate 'token' parameter in self::getFinalParams(). Also, self::mustBePosted() must return true when tokens are used.

In previous versions of MediaWiki, true was a valid return value. Returning true will generate errors indicating that the API module needs updating.

Returns
string|false

Definition at line 318 of file ApiBase.php.

Referenced by getFinalParams(), mustBePosted(), and validateToken().

ApiBase::parameterNotEmpty (   $x)
private

Callback function used in requireOnlyOneParameter to check whether required parameters are set.

Parameters
object$xParameter to check is not null/false
Returns
bool

Definition at line 626 of file ApiBase.php.

ApiBase::parseErrors (   $errors)
See Also
self::getPossibleErrors()
Deprecated:
since 1.24
Returns
array

Definition at line 2474 of file ApiBase.php.

References array(), and wfDeprecated().

ApiBase::parseMsg (   $error)

Return the error message related to a certain array.

Parameters
array$errorElement of a getUserPermissionsErrors()-style array
Returns
array('code' => code, 'info' => info)

Definition at line 1923 of file ApiBase.php.

References $key, array(), and wfMsgReplaceArgs().

Referenced by ApiImageRotate\checkPermissions(), dieReadOnly(), ApiUpload\dieRecoverableError(), dieUsageMsg(), dieUsageMsgOrDebug(), ApiPurge\execute(), and ApiMove\moveSubpages().

ApiBase::parseMultiValue (   $valueName,
  $value,
  $allowMultiple,
  $allowedValues 
)
protected

Return an array of values that were given in a 'a|b|c' notation, after it optionally validates them against the list allowed values.

Parameters
string$valueNameThe name of the parameter (for error reporting)
mixed$valueThe value being parsed
bool$allowMultipleCan $value contain more than one value separated by '|'?
string[]|null$allowedValues An array of values to check against. If null, all values are accepted.
Returns
string|string[] (allowMultiple ? an_array_of_values : a_single_value)

Definition at line 942 of file ApiBase.php.

References $s, $value, array(), dieUsage(), and setWarning().

Referenced by getParameterFromSettings().

ApiBase::requireAtLeastOneParameter (   $params,
  $required 
)

Die if none of a certain set of parameters is set and not false.

Since
1.23
Parameters
array$paramsUser provided set of parameters, as from $this->extractRequestParams()
string$required,...Names of parameters of which at least one must be set

Definition at line 604 of file ApiBase.php.

References $params, array(), dieUsage(), and getModulePrefix().

ApiBase::requireMaxOneParameter (   $params,
  $required 
)

Die if more than one of a certain set of parameters is set and not false.

Parameters
array$paramsUser provided set of parameters, as from $this->extractRequestParams()
string$required,...Names of parameters of which at most one must be set

Definition at line 581 of file ApiBase.php.

References $params, array(), dieUsage(), and getModulePrefix().

Referenced by ApiExpandTemplates\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryBlocks\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), ApiQueryLogEvents\execute(), and ApiQueryContributors\execute().

ApiBase::requireOnlyOneParameter (   $params,
  $required 
)

Die if none or more than one of a certain set of parameters is set and not false.

Parameters
array$paramsUser provided set of parameters, as from $this->extractRequestParams()
string$required,...Names of parameters of which exactly one must be set

Definition at line 555 of file ApiBase.php.

References $params, array(), dieUsage(), and getModulePrefix().

Referenced by ApiMove\execute(), ApiPatrol\execute(), ApiRollback\getRbTitle(), getTitleOrPageId(), ApiUserrights\getUrUser(), and ApiUpload\selectUploadModule().

ApiBase::safeProfileOut ( )

When modules crash, sometimes it is needed to do a profileOut() regardless of the profiling state the module was in.

This method does such cleanup.

Definition at line 2251 of file ApiBase.php.

References profileDBOut(), and profileOut().

ApiBase::setWatch (   $watch,
  $titleObj,
  $userOption = null 
)
protected

Set a watch (or unwatch) based the based on a watchlist parameter.

Parameters
string$watchValid values: 'watch', 'unwatch', 'preferences', 'nochange'
Title$titleObjThe article's title to change
string$userOptionThe user option to consider when $watch=preferences

Definition at line 1126 of file ApiBase.php.

References $value, WatchAction\doWatchOrUnwatch(), ContextSource\getUser(), and getWatchlistValue().

Referenced by ApiProtect\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiRollback\execute(), and ApiDelete\execute().

ApiBase::shouldCheckMaxlag ( )

Indicates if this module needs maxlag to be checked.

Returns
bool

Definition at line 253 of file ApiBase.php.

static ApiBase::truncateArray ( $arr,
  $limit 
)
static

Truncate an array to a certain length.

Parameters
array$arrArray to truncate
int$limitMaximum length
Returns
bool True if the array was truncated, false otherwise

Definition at line 1141 of file ApiBase.php.

References $limit.

ApiBase::validateLimit (   $paramName,
$value,
  $min,
  $max,
  $botMax = null,
  $enforceLimits = false 
)
protected

Validate the value against the minimum and user/bot maximum limits.

Prints usage info on failure.

Parameters
string$paramNameParameter name
int$valueParameter value
int | null$minMinimum value
int | null$maxMaximum value for users
int$botMaxMaximum value for sysops/bots
bool$enforceLimitsWhether to enforce (die) if value is outside limits

Definition at line 1006 of file ApiBase.php.

References $value, encodeParamName(), getMain(), and warnOrDie().

Referenced by ApiQueryDeletedrevs\execute(), getParameterFromSettings(), and ApiQueryRevisionsBase\parseParameters().

ApiBase::validateTimestamp (   $value,
  $encParamName 
)
protected

Validate and normalize of parameters of type 'timestamp'.

Parameters
string$valueParameter value
string$encParamNameParameter name
Returns
string Validated and normalized parameter

Definition at line 1044 of file ApiBase.php.

References $value, dieUsage(), TS_MW, TS_UNIX, and wfTimestamp().

Referenced by getParameterFromSettings().

ApiBase::validateToken (   $token,
array  $params 
)
final

Validate the supplied token.

Since
1.24
Parameters
string$tokenSupplied token
array$paramsAll supplied parameters for the module
Returns
bool
Exceptions
MWException

Definition at line 1065 of file ApiBase.php.

References ContextSource\getRequest(), ApiQueryTokens\getTokenTypeSalts(), ContextSource\getUser(), getWebUITokenSalt(), and needsToken().

ApiBase::validateUser (   $value,
  $encParamName 
)
private

Validate and normalize of parameters of type 'user'.

Parameters
string$valueParameter value
string$encParamNameParameter name
Returns
string Validated and normalized parameter

Definition at line 1101 of file ApiBase.php.

References $title, $value, dieUsage(), Title\makeTitleSafe(), and NS_USER.

Referenced by getParameterFromSettings().

ApiBase::warnOrDie (   $msg,
  $enforceLimits = false 
)
private

Adds a warning to the output, else dies.

Parameters
string$msgMessage to show as a warning, or error message if dying
bool$enforceLimitsWhether this is an enforce (die)

Definition at line 1277 of file ApiBase.php.

References dieUsage(), and setWarning().

Referenced by validateLimit().

Member Data Documentation

ScopedCallback ApiBase::$dbProfile
private

Profiling: total module execution time.

Definition at line 2200 of file ApiBase.php.

ApiBase::$mDBTime = 0

Profiling: total module execution time.

Definition at line 2275 of file ApiBase.php.

Referenced by getProfileDBTime().

ApiBase::$mDBTimeIn = 0
private

Profiling: database execution time.

Definition at line 2275 of file ApiBase.php.

Referenced by profileDBOut().

ApiBase::$messageMap
static

Array that maps message keys to error messages.

$1 and friends are replaced.

Definition at line 1364 of file ApiBase.php.

Referenced by getErrorFromStatus().

ApiMain ApiBase::$mMainModule
private

Definition at line 104 of file ApiBase.php.

Referenced by getMain(), and isMain().

string ApiBase::$mModuleName
private

Definition at line 105 of file ApiBase.php.

Referenced by getModuleName(), and getModuleProfileName().

string ApiBase::$mModulePrefix

Definition at line 105 of file ApiBase.php.

Referenced by getModulePrefix().

ApiBase::$mModuleTime = 0

Profiling: total module execution time.

Definition at line 2198 of file ApiBase.php.

Referenced by getProfileTime().

ApiBase::$mParamCache = array()
private

Definition at line 107 of file ApiBase.php.

ApiBase::$mSlaveDB = null
private

Definition at line 106 of file ApiBase.php.

Referenced by getDB().

ApiBase::$mTimeIn = 0
private

Profiling: total module execution time.

Definition at line 2198 of file ApiBase.php.

Referenced by profileOut().

ScopedCallback ApiBase::$profile
private

Profiling: total module execution time.

Definition at line 2199 of file ApiBase.php.

const ApiBase::GET_VALUES_FOR_HELP = 1

getAllowedParams() flag: When set, the result could take longer to generate, but should be more thorough.

E.g. get the list of generators for ApiSandBox extension

Since
1.21

Definition at line 102 of file ApiBase.php.

Referenced by ApiQueryLogEvents\getAllowedParams(), ApiPageSet\getAllowedParams(), getFinalParamDescription(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and makeHelpMsgParameters().

const ApiBase::LIMIT_BIG1 = 500

Definition at line 92 of file ApiBase.php.

Referenced by ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().

const ApiBase::LIMIT_BIG2 = 5000

Definition at line 93 of file ApiBase.php.

Referenced by ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().

const ApiBase::PARAM_ALLOW_DUPLICATES = 6
const ApiBase::PARAM_DFLT = 0

Definition at line 46 of file ApiBase.php.

Referenced by ApiQueryFileRepoInfo\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPrefixSearch\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiOptions\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiCreateAccount\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiMove\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiFormatXml\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiHelp\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiMain\getAllowedParams(), ApiPageSet\getAllowedParams(), ORMTable\getAPIParams(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and makeHelpMsgParameters().

const ApiBase::PARAM_HELP_MSG = 10
Since
1.25

Definition at line 70 of file ApiBase.php.

Referenced by ApiQueryStashImageInfo\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiQueryCategoryInfo\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiPurge\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiFormatXml\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), getFinalParamDescription(), and getFinalParams().

const ApiBase::PARAM_ISMULTI = 1

Definition at line 48 of file ApiBase.php.

Referenced by ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryPrefixSearch\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiOptions\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiHelp\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiPageSet\getAllowedParams(), ORMTable\getAPIParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().

const ApiBase::PARAM_MAX = 3

Definition at line 52 of file ApiBase.php.

Referenced by ApiQueryPagePropNames\getAllowedParams(), ApiQueryPrefixSearch\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().

const ApiBase::PARAM_MAX2 = 4

Definition at line 54 of file ApiBase.php.

Referenced by ApiQueryPagePropNames\getAllowedParams(), ApiQueryPrefixSearch\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().

const ApiBase::PARAM_MIN = 5

Definition at line 56 of file ApiBase.php.

Referenced by ApiQueryPagePropNames\getAllowedParams(), ApiQueryPrefixSearch\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().

const ApiBase::PARAM_RANGE_ENFORCE = 9
Since
1.17

Definition at line 66 of file ApiBase.php.

const ApiBase::PARAM_TYPE = 2

Definition at line 50 of file ApiBase.php.

Referenced by ApiCheckToken\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiQueryPrefixSearch\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiImport\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiOptions\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiBlock\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiWatch\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiCreateAccount\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiMove\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryORM\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiMain\getAllowedParams(), ApiPageSet\getAllowedParams(), ORMTable\getAPIParams(), getFinalParamDescription(), getFinalParams(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and makeHelpMsgParameters().

const ApiBase::PARAM_VALUE_LINKS = 13
Since
1.25

Definition at line 85 of file ApiBase.php.

Referenced by ApiPageSet\getAllowedParams(), and ApiHelp\getHelpInternal().

const ApiBase::PROP_LIST = 'LIST'
Deprecated:
since 1.24

Definition at line 2352 of file ApiBase.php.

const ApiBase::PROP_NULLABLE = 1
Deprecated:
since 1.24

Definition at line 2356 of file ApiBase.php.

const ApiBase::PROP_ROOT = 'ROOT'
Deprecated:
since 1.24

Definition at line 2350 of file ApiBase.php.

const ApiBase::PROP_TYPE = 0
Deprecated:
since 1.24

Definition at line 2354 of file ApiBase.php.


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