MediaWiki  1.23.15
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 ( $mainModule, $moduleName, $modulePrefix='')
 Constructor. More...
 
 createContext ()
 Create a new RequestContext object to use e.g. More...
 
 dieReadOnly ()
 Helper function for readonly errors. More...
 
 dieStatus ( $status)
 Throw a UsageException based on the errors in the Status object. 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...
 
 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...
 
 encodeParamName ( $paramName)
 This method mangles parameter name based on the prefix supplied to the constructor. More...
 
 execute ()
 Evaluates the parameters, performs the requested query, and sets up the result. 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...
 
 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...
 
 getErrorFromStatus ( $status)
 Get error (as code, string) from a Status object. More...
 
 getFinalDescription ()
 Get final module description, 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...
 
 getFinalParams ( $flags=0)
 Get final list of parameters, after hooks have had a chance to tweak it as needed. More...
 
 getFinalPossibleErrors ()
 Get final list of possible errors, after hooks have had a chance to tweak it as needed. More...
 
 getFinalResultProperties ()
 Get final possible result properties, after hooks have had a chance to tweak it as needed. More...
 
 getHelpUrls ()
 
 getMain ()
 Get the main module. More...
 
 getModuleManager ()
 Get the module manager, or null if this module has no sub-modules. More...
 
 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...
 
 getModuleProfileName ( $db=false)
 Get the name of the module as shown in the profiler log. More...
 
 getPossibleErrors ()
 Returns a list of all possible errors returned by the module. More...
 
 getProfileDBTime ()
 Total time the module used the database. More...
 
 getProfileTime ()
 Total time the module was executed. More...
 
 getRequireAtLeastOneParameterErrorMessages ( $params)
 Generates the possible errors requireAtLeastOneParameter() can die with. More...
 
 getRequireMaxOneParameterErrorMessages ( $params)
 Generates the possible error requireMaxOneParameter() can die with. More...
 
 getRequireOnlyOneParameterErrorMessages ( $params)
 Generates the possible errors requireOnlyOneParameter() can die with. More...
 
 getResult ()
 Get the result object. More...
 
 getResultData ()
 Get the result data array (read-only) More...
 
 getTitleOrPageId ( $params, $load=false)
 
 getTitleOrPageIdErrorMessage ()
 
 getTokenSalt ()
 Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token You have also to override needsToken() Value is passed to User::getEditToken. More...
 
 getVersion ()
 Returns a string that identifies the version of the extending class. More...
 
 getWatchlistUser ( $params)
 Gets the user for whom to get the watchlist. More...
 
 isMain ()
 Returns true if this module is the main module ($this === $this->mMainModule), false otherwise. More...
 
 isReadMode ()
 Indicates whether this module requires read rights. More...
 
 isWriteMode ()
 Indicates whether this module requires write mode. More...
 
 lacksSameOriginSecurity ()
 Returns true if the current request breaks the same-origin policy. More...
 
 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...
 
 mustBePosted ()
 Indicates whether this module must be called with a POST request. More...
 
 needsToken ()
 Returns whether this module requires a token to execute It is used to show possible errors in action=paraminfo see bug 25248. More...
 
 parseErrors ( $errors)
 Parses a list of errors into a standardised format. More...
 
 parseMsg ( $error)
 Return the error message related to a certain array. More...
 
 profileDBIn ()
 Start module profiling. More...
 
 profileDBOut ()
 End database profiling. More...
 
 profileIn ()
 Start module profiling. More...
 
 profileOut ()
 End module profiling. More...
 
 requireAtLeastOneParameter ( $params)
 Die if none of a certain set of parameters is set and not false. More...
 
 requireMaxOneParameter ( $params)
 Die if more than one of a certain set of parameters is set and not false. More...
 
 requireOnlyOneParameter ( $params)
 Die if none or more than one of a certain set of parameters is set and not false. More...
 
 safeProfileOut ()
 When modules crash, sometimes it is needed to do a profileOut() regardless of the profiling state the module was in. More...
 
 setWarning ( $warning)
 Set warning section for this module. More...
 
 shouldCheckMaxlag ()
 Indicates if this module needs maxlag to be checked. 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...
 
- 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 RequestContext object. More...
 
 getLang ()
 Get the Language 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...
 

Static Public Member Functions

static debugPrint ( $value, $name='unknown', $backtrace=false)
 Debugging function that prints a value and an optional backtrace. More...
 
static truncateArray (&$arr, $limit)
 Truncate an array to a certain length. More...
 

Public Attributes

 $mDBTime = 0
 
 $mModuleName
 
 $mModulePrefix
 
 $mModuleTime = 0
 
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_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 PROP_LIST = 'LIST'
 
const PROP_NULLABLE = 1
 
const PROP_ROOT = 'ROOT'
 
const PROP_TYPE = 0
 

Static Public Attributes

static $messageMap
 Array that maps message keys to error messages. More...
 

Protected Member Functions

 dieContinueUsageIf ( $condition)
 Die with the $prefix. 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...
 
 getDB ()
 Gets a default slave database connection object. More...
 
 getDescription ()
 Returns the description string for this module. More...
 
 getExamples ()
 Returns usage examples for this module. More...
 
 getParamDescription ()
 Returns an array of parameter descriptions. More...
 
 getParameter ( $paramName, $parseLimit=true)
 Get a value for the given parameter. More...
 
 getParameterFromSettings ( $paramName, $paramSettings, $parseLimit)
 Using the settings determine the value for the given parameter. More...
 
 getResultProperties ()
 Returns possible properties in the result, grouped by the value of the prop parameter that shows them. More...
 
 getWatchlistValue ( $watchlist, $titleObj, $userOption=null)
 Return true if we're to watch the page, false if not, null if no change. More...
 
 makeHelpArrayToString ( $prefix, $title, $input)
 
 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...
 
 setWatch ( $watch, $titleObj, $userOption=null)
 Set a watch (or unwatch) based the based on a watchlist parameter. More...
 

Static Protected Member Functions

static addTokenProperties (&$props, $tokenFunctions)
 Add token properties to the array used by getResultProperties, based on a token functions mapping. More...
 
static dieDebug ( $method, $message)
 Internal code errors should be reported with this method. More...
 

Private Member Functions

 indentExampleText ( $item)
 
 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...
 
 warnOrDie ( $msg, $enforceLimits=false)
 Adds a warning to the output, else dies. More...
 

Private Attributes

 $mDBTimeIn = 0
 Profiling: database execution time. More...
 
 $mMainModule
 
 $mParamCache = array()
 
 $mSlaveDB = null
 
 $mTimeIn = 0
 Profiling: total module execution time. More...
 

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

◆ __construct()

ApiBase::__construct (   $mainModule,
  $moduleName,
  $modulePrefix = '' 
)

Constructor.

Parameters
$mainModuleApiMain object
string$moduleNameName of this module
string$modulePrefixPrefix to use for parameter names

Reimplemented in ApiQueryImageInfo.

Definition at line 100 of file ApiBase.php.

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

Member Function Documentation

◆ addTokenProperties()

static ApiBase::addTokenProperties ( $props,
  $tokenFunctions 
)
staticprotected

Add token properties to the array used by getResultProperties, based on a token functions mapping.

Definition at line 666 of file ApiBase.php.

Referenced by ApiTokens\getResultProperties(), ApiQueryUsers\getResultProperties(), ApiQueryRecentChanges\getResultProperties(), ApiQueryRevisions\getResultProperties(), and ApiQueryInfo\getResultProperties().

◆ createContext()

ApiBase::createContext ( )

Create a new RequestContext object to use e.g.

for calls to other parts the software. The object will have the WebRequest and the User object set to the ones used in this instance.

Deprecated:
since 1.19 use getContext to get the current context
Returns
DerivativeContext

Definition at line 232 of file ApiBase.php.

◆ debugPrint()

static ApiBase::debugPrint (   $value,
  $name = 'unknown',
  $backtrace = false 
)
static

Debugging function that prints a value and an optional backtrace.

Parameters
$valuemixed Value to print
string$nameDescription of the printed value
bool$backtraceIf true, print a backtrace

Definition at line 2352 of file ApiBase.php.

◆ dieContinueUsageIf()

◆ dieDebug()

◆ dieReadOnly()

ApiBase::dieReadOnly ( )

Helper function for readonly errors.

Definition at line 1943 of file ApiBase.php.

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

◆ dieStatus()

ApiBase::dieStatus (   $status)

Throw a UsageException based on the errors in the Status object.

Since
1.22
Parameters
Status$statusStatus object
Exceptions
MWException

Definition at line 1439 of file ApiBase.php.

Referenced by ApiCreateAccount\execute(), ApiProtect\execute(), ApiImport\execute(), ApiDelete\execute(), ApiUserrights\getUrUser(), and ApiWatch\watchTitle().

◆ dieUsage()

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 1383 of file ApiBase.php.

Referenced by ApiMain\checkAsserts(), ApiUpload\checkAsyncDownloadEnabled(), ApiMain\checkMaxLag(), ApiParse\checkReadPermissions(), ApiUpload\checkVerification(), ApiMain\createPrinterByName(), ApiUpload\dieRecoverableError(), ApiComparePages\execute(), ApiCreateAccount\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiEditPage\execute(), ApiUpload\execute(), ApiWatch\execute(), ApiHelp\execute(), ApiPatrol\execute(), ApiSetNotificationTimestamp\execute(), ApiOptions\execute(), ApiFormatPhp\execute(), ApiQueryDeletedrevs\execute(), ApiQueryAllMessages\execute(), ApiDisabled\execute(), ApiQueryFilearchive\execute(), ApiFeedContributions\execute(), ApiParse\execute(), ApiFeedRecentChanges\execute(), ApiQueryBlocks\execute(), ApiQueryLogEvents\execute(), ApiQueryContributions\execute(), ApiQueryAllUsers\execute(), ApiFeedWatchlist\execute(), ApiQueryRevisions\execute(), ApiQueryAllPages\executeGenerator(), ApiQueryAllImages\executeGenerator(), ApiPageSet\executeInternal(), ApiQueryRevisions\extractRowInfo(), ApiUpload\getChunkResult(), ApiParse\getParsedContent(), ApiQueryImageInfo\getScale(), ApiParse\getSectionContent(), ApiUpload\getStashResult(), ApiQueryImageInfo\mergeThumbParams(), ApiUpload\performUpload(), ApiQueryContributions\prepareQuery(), ApiQueryBase\prepareUrlQuerySearchString(), ApiQueryContributions\prepareUsername(), ApiQueryBlocks\prepareUsername(), ApiComparePages\revisionOrTitleOrId(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQuerySearch\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ApiUpload\selectUploadModule(), ApiMain\setupExecuteAction(), and ApiMain\setupModule().

◆ dieUsageMsg()

◆ dieUsageMsgOrDebug()

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
$error(array|string) Element of a getUserPermissionsErrors()-style array
Since
1.21

Definition at line 1969 of file ApiBase.php.

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

◆ encodeParamName()

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

Reimplemented in ApiQueryGeneratorBase.

Definition at line 694 of file ApiBase.php.

Referenced by ApiQueryLogEvents\execute(), and ApiQueryBase\setContinueEnumParameter().

◆ execute()

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

Reimplemented in ApiResult, ApiFormatFeedWrapper, ApiMain, ApiQueryInfo, ApiQuery, ApiPageSet, ApiQueryRecentChanges, ApiQueryAllLinks, ApiQueryBacklinks, ApiQueryRevisions, ApiQueryORM, ApiQueryUsers, ApiQueryLinks, ApiFormatJson, ApiFormatRaw, ApiFeedWatchlist, ApiQueryAllImages, ApiImageRotate, ApiLogin, ApiOpenSearch, ApiQueryAllUsers, ApiQueryContributors, ApiQueryQueryPage, ApiQueryImageInfo, ApiQuerySearch, ApiQueryTags, ApiQueryFileRepoInfo, ApiQueryLogEvents, ApiQueryPagePropNames, ApiQueryContributions, ApiFeedRecentChanges, ApiParse, ApiQueryBlocks, ApiBlock, ApiDelete, ApiFeedContributions, ApiParamInfo, ApiFormatDbg, ApiFormatDump, ApiFormatTxt, ApiQueryFilearchive, ApiQueryPageProps, ApiQueryRandom, ApiQueryUserInfo, ApiRollback, ApiDisabled, ApiQueryAllCategories, ApiQueryCategoryInfo, ApiQueryDisabled, ApiQueryImages, ApiQueryIWLinks, ApiQueryPagesWithProp, ApiQueryRedirects, ApiQueryWatchlist, ApiQueryWatchlistRaw, ApiPurge, ApiQueryAllMessages, ApiQueryAllPages, ApiQueryCategories, ApiQueryCategoryMembers, ApiQueryDeletedrevs, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryProtectedTitles, ApiUnblock, ApiFileRevert, ApiFormatNone, ApiFormatPhp, ApiOptions, ApiExpandTemplates, ApiHelp, ApiPatrol, ApiQueryExtLinksUsage, ApiSetNotificationTimestamp, ApiEditPage, ApiLogout, ApiUpload, ApiUserrights, ApiWatch, ApiImport, ApiQueryStashImageInfo, ApiRevisionDelete, ApiRsd, ApiEmailUser, ApiMove, ApiTokens, ApiUndelete, ApiCreateAccount, ApiProtect, ApiQueryPrefixSearch, ApiComparePages, MockApi, and MockApiQueryBase.

◆ extractRequestParams()

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
$parseLimitBoolean: true by default
Returns
array

Definition at line 707 of file ApiBase.php.

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

◆ getAllowedParams()

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|bool

Reimplemented in ApiMain, ApiQueryInfo, ApiUpload, ApiParse, ApiQueryRevisions, ApiQueryRecentChanges, ApiQueryImageInfo, ApiEditPage, ApiQueryWatchlist, ApiQueryContributions, ApiQueryBacklinks, ApiQueryDeletedrevs, ApiQueryAllUsers, ApiParamInfo, ApiQueryAllImages, ApiQueryUsers, ApiQueryBlocks, ApiQueryCategoryMembers, ApiQueryAllLinks, ApiQuerySearch, ApiQueryFilearchive, ApiQueryORM, ApiQueryAllPages, ApiQueryContributors, ApiQueryRedirects, ApiQueryAllMessages, ApiQueryUserInfo, ApiMove, ApiQueryLinks, ApiCreateAccount, ApiDelete, ApiQueryCategories, ApiLogin, ApiQueryProtectedTitles, ApiRevisionDelete, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiFeedContributions, ApiQueryDuplicateFiles, ApiQueryAllCategories, ApiQueryRandom, ApiBlock, ApiQueryExtLinksUsage, ApiQueryQueryPage, ApiProtect, ApiQueryImages, ApiQueryIWLinks, ApiQueryLangLinks, ApiQueryTags, ApiHelp, ApiOptions, ApiQueryWatchlistRaw, ApiQueryPagesWithProp, ApiQueryPageProps, ApiFileRevert, ApiFeedRecentChanges, ApiComparePages, ApiQueryExternalLinks, ApiQueryCategoryInfo, ApiImport, ApiUndelete, ApiUserrights, ApiFormatJson, ApiEmailUser, ApiUnblock, ApiQueryPagePropNames, ApiRollback, ApiQueryPrefixSearch, ApiExpandTemplates, ApiPatrol, ApiQueryStashImageInfo, ApiTokens, ApiOpenSearch, ApiQueryFileRepoInfo, ApiRsd, ApiLogout, ApiDisabled, ApiQueryDisabled, and MockApi.

Definition at line 585 of file ApiBase.php.

◆ getCustomPrinter()

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.

Returns
mixed instance of a derived class of ApiFormatBase, or null

Reimplemented in ApiQuery, ApiRsd, ApiFeedWatchlist, ApiFeedContributions, ApiOpenSearch, and ApiFeedRecentChanges.

Definition at line 278 of file ApiBase.php.

◆ getDB()

ApiBase::getDB ( )
protected

Gets a default slave database connection object.

Returns
DatabaseBase

Reimplemented in ApiPageSet, ApiQueryBase, and ApiQueryAllImages.

Definition at line 2336 of file ApiBase.php.

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

◆ getDescription()

ApiBase::getDescription ( )
protected

Returns the description string for this module.

Returns
mixed string or array of strings

Reimplemented in ApiMain, ApiQueryInfo, ApiQueryRecentChanges, ApiQueryImageInfo, ApiQueryRevisions, ApiUpload, ApiParse, ApiQuery, ApiQueryWatchlist, ApiQueryContributions, ApiQueryLogEvents, ApiQueryBacklinks, ApiQueryDeletedrevs, ApiEditPage, ApiQueryAllUsers, ApiQueryBlocks, ApiQueryCategoryMembers, ApiQuerySearch, ApiQueryAllImages, ApiQueryUsers, ApiQueryFilearchive, ApiParamInfo, ApiQueryAllLinks, ApiQueryAllPages, ApiFormatBase, ApiQueryUserInfo, ApiQueryAllMessages, ApiQueryProtectedTitles, ApiMove, ApiQueryContributors, ApiSetNotificationTimestamp, ApiFeedWatchlist, ApiQueryExtLinksUsage, ApiLogin, ApiQueryCategories, ApiQueryRedirects, ApiDelete, ApiQueryLinks, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryAllCategories, ApiBlock, ApiRevisionDelete, ApiQueryLangLinks, ApiProtect, ApiWatch, ApiFeedContributions, ApiQueryWatchlistRaw, ApiImageRotate, ApiQueryDuplicateFiles, ApiQueryQueryPage, ApiFeedRecentChanges, ApiQueryTags, ApiOptions, ApiQueryIWLinks, ApiQueryRandom, ApiPurge, ApiQueryImages, ApiQueryPagesWithProp, ApiCreateAccount, ApiFileRevert, ApiComparePages, ApiHelp, ApiQueryExternalLinks, ApiImport, ApiQueryCategoryInfo, ApiQueryPageProps, ApiUndelete, ApiRollback, ApiUnblock, ApiEmailUser, ApiQueryStashImageInfo, ApiUserrights, ApiPatrol, ApiQueryPrefixSearch, ApiExpandTemplates, ApiOpenSearch, ApiQueryFileRepoInfo, ApiQueryPagePropNames, ApiFormatJson, ApiTokens, ApiRsd, ApiLogout, ApiFormatPhp, ApiDisabled, ApiQueryDisabled, ApiFormatDump, ApiFormatDbg, ApiFormatTxt, ApiFormatNone, and ApiFormatYaml.

Definition at line 561 of file ApiBase.php.

◆ getErrorFromStatus()

ApiBase::getErrorFromStatus (   $status)

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

Since
1.23
Parameters
Status$statusStatus object
Returns
array of code and error string

Definition at line 1400 of file ApiBase.php.

Referenced by ApiWatch\watchTitle().

◆ getExamples()

ApiBase::getExamples ( )
protected

Returns usage examples for this module.

Return false if no examples are available.

Returns
bool|string|array

Reimplemented in ApiUpload, ApiQueryRevisions, ApiQueryRecentChanges, ApiQueryInfo, ApiQueryImageInfo, ApiParse, ApiQuery, ApiEditPage, ApiQueryWatchlist, ApiQueryContributions, ApiQueryLogEvents, ApiQueryBacklinks, ApiQueryDeletedrevs, ApiQueryAllImages, ApiQueryAllUsers, ApiQueryBlocks, ApiQueryCategoryMembers, ApiQuerySearch, ApiQueryUsers, ApiQueryFilearchive, ApiQueryAllLinks, ApiQueryAllPages, ApiParamInfo, ApiFormatBase, ApiCreateAccount, ApiQueryUserInfo, ApiMove, ApiSetNotificationTimestamp, ApiLogin, ApiQueryAllMessages, ApiQueryProtectedTitles, ApiQueryContributors, ApiFeedWatchlist, ApiQueryExtLinksUsage, ApiDelete, ApiQueryCategories, ApiQueryRedirects, ApiBlock, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiProtect, ApiRevisionDelete, ApiQueryLinks, ApiQueryAllCategories, ApiQueryLangLinks, ApiImageRotate, ApiWatch, ApiQueryWatchlistRaw, ApiFeedContributions, ApiOptions, ApiQueryQueryPage, ApiFeedRecentChanges, ApiQueryDuplicateFiles, ApiRollback, ApiQueryRandom, ApiQueryIWLinks, ApiPurge, ApiQueryTags, ApiFileRevert, ApiQueryImages, ApiQueryPagesWithProp, ApiComparePages, ApiImport, ApiUndelete, ApiQueryExternalLinks, ApiHelp, ApiUnblock, ApiEmailUser, ApiQueryCategoryInfo, ApiQueryPageProps, ApiPatrol, ApiUserrights, ApiQueryStashImageInfo, ApiExpandTemplates, ApiQueryPrefixSearch, ApiOpenSearch, ApiQueryFileRepoInfo, ApiQueryPagePropNames, ApiTokens, ApiRsd, ApiLogout, ApiDisabled, and ApiQueryDisabled.

Definition at line 569 of file ApiBase.php.

◆ getFinalDescription()

ApiBase::getFinalDescription ( )

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

Returns
array|bool False on no parameters

Definition at line 681 of file ApiBase.php.

◆ getFinalParamDescription()

ApiBase::getFinalParamDescription ( )

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

Returns
array|bool False on no parameter descriptions

Definition at line 622 of file ApiBase.php.

◆ getFinalParams()

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 609 of file ApiBase.php.

◆ getFinalPossibleErrors()

ApiBase::getFinalPossibleErrors ( )

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

Returns
array
Since
1.22

Definition at line 2191 of file ApiBase.php.

Referenced by ApiPurge\getPossibleErrors(), and ApiQuery\getPossibleErrors().

◆ getFinalResultProperties()

ApiBase::getFinalResultProperties ( )

Get final possible result properties, after hooks have had a chance to tweak it as needed.

Returns
array

Definition at line 655 of file ApiBase.php.

◆ getHelpUrls()

◆ getMain()

◆ getModuleManager()

ApiBase::getModuleManager ( )

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

Since
1.21
Returns
ApiModuleManager

Reimplemented in ApiMain, and ApiQuery.

Definition at line 157 of file ApiBase.php.

◆ getModuleName()

ApiBase::getModuleName ( )

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

Returns
string

Definition at line 148 of file ApiBase.php.

Referenced by ApiPageSet\__construct(), ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryTags\doTag(), ApiComparePages\execute(), ApiProtect\execute(), ApiTokens\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiMove\execute(), ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiWatch\execute(), ApiEditPage\execute(), ApiHelp\execute(), ApiPatrol\execute(), ApiExpandTemplates\execute(), ApiSetNotificationTimestamp\execute(), ApiOptions\execute(), ApiFileRevert\execute(), ApiUnblock\execute(), ApiQueryDeletedrevs\execute(), ApiPurge\execute(), ApiQueryAllMessages\execute(), ApiQueryFilearchive\execute(), ApiRollback\execute(), ApiQueryUserInfo\execute(), ApiParamInfo\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiParse\execute(), ApiQueryBlocks\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryTags\execute(), ApiQueryAllUsers\execute(), ApiImageRotate\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQueryLinks\getExamples(), ApiFormatBase\getExamples(), ApiQueryAllLinks\getExamples(), ApiQueryAllLinks\getHelpUrls(), ApiQueryAllLinks\getPossibleErrors(), ApiMain\makeHelpMsg(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryQueryPage\run(), ApiQuerySearch\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryRandom\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ApiQueryBacklinks\run(), ApiQueryRandom\runQuery(), ApiUpload\selectUploadModule(), and ApiQueryBase\setContinueEnumParameter().

◆ getModulePrefix()

ApiBase::getModulePrefix ( )

Get parameter prefix (usually two letters or an empty string).

Returns
string

Definition at line 165 of file ApiBase.php.

Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryStashImageInfo\execute(), ApiWatch\execute(), ApiQueryDeletedrevs\getDescription(), ApiParse\getDescription(), ApiQueryAllLinks\getExamples(), ApiUnblock\getParamDescription(), ApiQueryStashImageInfo\getParamDescription(), ApiQueryExternalLinks\getParamDescription(), ApiProtect\getParamDescription(), ApiCreateAccount\getParamDescription(), ApiQueryExtLinksUsage\getParamDescription(), ApiDelete\getParamDescription(), ApiQueryProtectedTitles\getParamDescription(), ApiMove\getParamDescription(), ApiQueryAllPages\getParamDescription(), ApiQueryAllLinks\getParamDescription(), ApiQueryBlocks\getParamDescription(), ApiQueryCategoryMembers\getParamDescription(), ApiQueryAllImages\getParamDescription(), ApiQueryDeletedrevs\getParamDescription(), ApiQueryContributions\getParamDescription(), ApiQueryLogEvents\getParamDescription(), ApiQueryWatchlist\getParamDescription(), ApiEditPage\getParamDescription(), ApiQueryImageInfo\getParamDescription(), ApiQueryRecentChanges\getParamDescription(), ApiParse\getParamDescription(), ApiQueryRevisions\getParamDescription(), ApiQueryAllImages\getPossibleErrors(), ApiQueryImageInfo\getPossibleErrors(), ApiQueryImageInfo\getScale(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllImages\run(), and ApiQueryAllLinks\run().

◆ getModuleProfileName()

ApiBase::getModuleProfileName (   $db = false)

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

Parameters
$dbDatabaseBase|bool
Returns
string

Definition at line 176 of file ApiBase.php.

◆ getParamDescription()

ApiBase::getParamDescription ( )
protected

Returns an array of parameter descriptions.

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

Returns
array|bool False on no parameter descriptions

Reimplemented in ApiPageSet, ApiMain, ApiUpload, ApiQueryInfo, ApiQueryRevisions, ApiParse, ApiQueryRecentChanges, ApiQuery, ApiQueryImageInfo, ApiEditPage, ApiQueryWatchlist, ApiQueryLogEvents, ApiQueryContributions, ApiQueryBacklinks, ApiQueryDeletedrevs, ApiQueryAllUsers, ApiQueryAllImages, ApiQueryCategoryMembers, ApiParamInfo, ApiQueryBlocks, ApiQuerySearch, ApiQueryAllLinks, ApiQueryUsers, ApiQueryAllPages, ApiQueryFilearchive, ApiQueryORM, ApiFeedWatchlist, ApiQueryContributors, ApiQueryAllMessages, ApiQueryRedirects, ApiMove, ApiQueryProtectedTitles, ApiSetNotificationTimestamp, ApiQueryUserInfo, ApiQueryCategories, ApiDelete, ApiQueryLinks, ApiQueryExtLinksUsage, ApiCreateAccount, ApiRevisionDelete, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiImageRotate, ApiFeedContributions, ApiQueryAllCategories, ApiWatch, ApiLogin, ApiQueryDuplicateFiles, ApiProtect, ApiQueryLangLinks, ApiQueryWatchlistRaw, ApiFeedRecentChanges, ApiOptions, ApiBlock, ApiQueryRandom, ApiQueryImages, ApiQueryIWLinks, ApiQueryPagesWithProp, ApiQueryQueryPage, ApiQueryTags, ApiHelp, ApiPurge, ApiFileRevert, ApiQueryPageProps, ApiComparePages, ApiQueryExternalLinks, ApiImport, ApiUndelete, ApiUserrights, ApiQueryStashImageInfo, ApiRollback, ApiQueryCategoryInfo, ApiEmailUser, ApiQueryPrefixSearch, ApiOpenSearch, ApiQueryPagePropNames, ApiUnblock, ApiFormatJson, ApiTokens, ApiExpandTemplates, ApiPatrol, ApiQueryFileRepoInfo, ApiRsd, ApiLogout, ApiDisabled, and ApiQueryDisabled.

Definition at line 597 of file ApiBase.php.

◆ getParameter()

ApiBase::getParameter (   $paramName,
  $parseLimit = true 
)
protected

Get a value for the given parameter.

Parameters
string$paramNameParameter name
bool$parseLimitsee extractRequestParams()
Returns
mixed Parameter value

Definition at line 731 of file ApiBase.php.

Referenced by ApiFeedRecentChanges\execute(), ApiQuery\getCustomPrinter(), ApiMain\handleCORS(), ApiMain\sendCacheHeaders(), ApiMain\setupExecuteAction(), and ApiMain\substituteResultWithError().

◆ getParameterFromSettings()

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.
$parseLimitBoolean: parse limit?
Returns
mixed Parameter value

Definition at line 990 of file ApiBase.php.

◆ getPossibleErrors()

◆ getProfileDBTime()

ApiBase::getProfileDBTime ( )

Total time the module used the database.

Returns
float

Definition at line 2324 of file ApiBase.php.

◆ getProfileTime()

ApiBase::getProfileTime ( )

Total time the module was executed.

Returns
float

Definition at line 2270 of file ApiBase.php.

◆ getRequireAtLeastOneParameterErrorMessages()

ApiBase::getRequireAtLeastOneParameterErrorMessages (   $params)

Generates the possible errors requireAtLeastOneParameter() can die with.

Since
1.23
Parameters
$paramsarray Array of parameter key names
Returns
array

Definition at line 853 of file ApiBase.php.

◆ getRequireMaxOneParameterErrorMessages()

ApiBase::getRequireMaxOneParameterErrorMessages (   $params)

Generates the possible error requireMaxOneParameter() can die with.

Parameters
$paramsarray
Returns
array

Definition at line 811 of file ApiBase.php.

Referenced by ApiQueryLangLinks\getPossibleErrors(), ApiQueryContributors\getPossibleErrors(), ApiSetNotificationTimestamp\getPossibleErrors(), and ApiQueryBlocks\getPossibleErrors().

◆ getRequireOnlyOneParameterErrorMessages()

ApiBase::getRequireOnlyOneParameterErrorMessages (   $params)

Generates the possible errors requireOnlyOneParameter() can die with.

Parameters
$paramsarray
Returns
array

Definition at line 768 of file ApiBase.php.

Referenced by ApiSetNotificationTimestamp\getPossibleErrors(), ApiMove\getPossibleErrors(), and ApiUpload\getPossibleErrors().

◆ getResult()

ApiBase::getResult ( )

Get the result object.

Returns
ApiResult

Reimplemented in ApiMain.

Definition at line 205 of file ApiBase.php.

Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryORM\addSerializedResults(), ApiUpload\checkVerification(), ApiComparePages\execute(), ApiCreateAccount\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiTokens\execute(), ApiMove\execute(), ApiEmailUser\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiRsd\execute(), ApiImport\execute(), ApiEditPage\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiWatch\execute(), ApiSetNotificationTimestamp\execute(), ApiPatrol\execute(), ApiHelp\execute(), ApiExpandTemplates\execute(), ApiOptions\execute(), ApiFileRevert\execute(), ApiQueryAllMessages\execute(), ApiQueryDeletedrevs\execute(), ApiUnblock\execute(), ApiPurge\execute(), ApiQueryUserInfo\execute(), ApiRollback\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiDelete\execute(), ApiFeedContributions\execute(), ApiParamInfo\execute(), ApiBlock\execute(), ApiFeedRecentChanges\execute(), ApiQueryBlocks\execute(), ApiParse\execute(), ApiQueryContributions\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryPagePropNames\execute(), ApiQueryTags\execute(), ApiQueryImageInfo\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiOpenSearch\execute(), ApiLogin\execute(), ApiImageRotate\execute(), ApiFeedWatchlist\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiQueryInfo\extractPageInfo(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), ApiRevisionDelete\extractStatusInfo(), ApiParse\formatLimitReportData(), ApiRsd\formatRsdApiList(), ApiRevisionDelete\formatStatusMessages(), ApiParamInfo\getClassInfo(), ApiQueryUserInfo\getCurrentUserInfo(), ApiQuery\outputGeneralPageInfo(), ApiUpload\performUpload(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryQueryPage\run(), ApiQuerySearch\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryRandom\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ApiQueryBacklinks\run(), ApiQueryRandom\runQuery(), ApiUpload\selectUploadModule(), ApiQueryBase\setContinueEnumParameter(), ApiQueryORM\setIndexedTagNames(), ApiParse\setIndexedTagNames(), and ApiUpload\transformWarnings().

◆ getResultData()

ApiBase::getResultData ( )

◆ getResultProperties()

ApiBase::getResultProperties ( )
protected

Returns possible properties in the result, grouped by the value of the prop parameter that shows them.

Properties that are shown always are in a group with empty string as a key. Properties that can be shown by several values of prop are included multiple times. If some properties are part of a list and some are on the root object (see ApiQueryQueryPage), those on the root object are under the key PROP_ROOT. The array can also contain a boolean under the key PROP_LIST, indicating whether the result is a list.

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

Returns
array|bool False on no properties

Reimplemented in ApiQueryImageInfo, ApiUpload, ApiQueryInfo, ApiQueryRevisions, ApiQueryRecentChanges, ApiEditPage, ApiQueryWatchlist, ApiQueryContributions, ApiQueryLogEvents, ApiQueryBacklinks, ApiQueryDeletedrevs, ApiQueryAllUsers, ApiQueryAllImages, ApiQueryCategoryMembers, ApiQueryBlocks, ApiQuerySearch, ApiQueryAllLinks, ApiQueryAllPages, ApiQueryUsers, ApiQueryFilearchive, ApiQueryAllMessages, ApiMove, ApiQueryProtectedTitles, ApiQueryExtLinksUsage, ApiQueryUserInfo, ApiQueryCategories, ApiSetNotificationTimestamp, ApiDelete, ApiCreateAccount, ApiQueryLinks, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryAllCategories, ApiProtect, ApiWatch, ApiLogin, ApiQueryLangLinks, ApiQueryWatchlistRaw, ApiQueryDuplicateFiles, ApiBlock, ApiQueryRandom, ApiQueryIWLinks, ApiQueryImages, ApiQueryTags, ApiQueryQueryPage, ApiOptions, ApiPurge, ApiFileRevert, ApiQueryExternalLinks, ApiComparePages, ApiImport, ApiUndelete, ApiQueryStashImageInfo, ApiRollback, ApiQueryCategoryInfo, ApiEmailUser, ApiUnblock, ApiExpandTemplates, ApiPatrol, ApiTokens, and ApiLogout.

Definition at line 645 of file ApiBase.php.

◆ getTitleOrPageId()

ApiBase::getTitleOrPageId (   $params,
  $load = false 
)
Parameters
$paramsarray
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 873 of file ApiBase.php.

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

◆ getTitleOrPageIdErrorMessage()

ApiBase::getTitleOrPageIdErrorMessage ( )

◆ getTokenSalt()

ApiBase::getTokenSalt ( )

Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token You have also to override needsToken() Value is passed to User::getEditToken.

Returns
bool|string|array

Reimplemented in ApiUpload, ApiEditPage, ApiMove, ApiDelete, ApiBlock, ApiProtect, ApiRevisionDelete, ApiImageRotate, ApiOptions, ApiSetNotificationTimestamp, ApiFileRevert, ApiImport, ApiWatch, ApiUndelete, ApiRollback, ApiUnblock, ApiEmailUser, ApiPatrol, and ApiUserrights.

Definition at line 2084 of file ApiBase.php.

◆ getVersion()

ApiBase::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
Deprecated:
since 1.21, version string is no longer supported

Reimplemented in MockApi, and MockApiQueryBase.

Definition at line 138 of file ApiBase.php.

◆ getWatchlistUser()

ApiBase::getWatchlistUser (   $params)

Gets the user for whom to get the watchlist.

Parameters
$paramsarray
Returns
User

Definition at line 2094 of file ApiBase.php.

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

◆ getWatchlistValue()

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'
$titleObjTitle the 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 933 of file ApiBase.php.

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

◆ indentExampleText()

ApiBase::indentExampleText (   $item)
private
Parameters
$itemstring
Returns
string

Definition at line 374 of file ApiBase.php.

◆ isMain()

ApiBase::isMain ( )

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

Returns
bool

Definition at line 197 of file ApiBase.php.

Referenced by __construct().

◆ isReadMode()

ApiBase::isReadMode ( )

Indicates whether this module requires read rights.

Returns
bool

Reimplemented in ApiMain, ApiParamInfo, ApiCreateAccount, ApiLogin, ApiHelp, ApiLogout, and ApiDisabled.

Definition at line 2046 of file ApiBase.php.

◆ isWriteMode()

ApiBase::isWriteMode ( )

◆ lacksSameOriginSecurity()

ApiBase::lacksSameOriginSecurity ( )

Returns true if the current request breaks the same-origin policy.

For example, json with callbacks.

https://en.wikipedia.org/wiki/Same-origin_policy

Since
1.25 (backported in 1.23.14)
Returns
bool

Reimplemented in ApiMain.

Definition at line 360 of file ApiBase.php.

◆ makeHelpArrayToString()

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

Definition at line 384 of file ApiBase.php.

◆ makeHelpMsg()

ApiBase::makeHelpMsg ( )

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

Returns
mixed string or false

Reimplemented in ApiMain, and ApiQuery.

Definition at line 286 of file ApiBase.php.

◆ makeHelpMsgParameters()

ApiBase::makeHelpMsgParameters ( )

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

Returns
string or false

Definition at line 411 of file ApiBase.php.

◆ mustBePosted()

ApiBase::mustBePosted ( )

◆ needsToken()

ApiBase::needsToken ( )

Returns whether this module requires a token to execute It is used to show possible errors in action=paraminfo see bug 25248.

Returns
bool

Reimplemented in ApiUpload, ApiEditPage, ApiMove, ApiDelete, ApiBlock, ApiProtect, ApiRevisionDelete, ApiImageRotate, ApiOptions, ApiSetNotificationTimestamp, ApiFileRevert, ApiImport, ApiWatch, ApiUndelete, ApiRollback, ApiUnblock, ApiEmailUser, ApiPatrol, and ApiUserrights.

Definition at line 2072 of file ApiBase.php.

◆ parameterNotEmpty()

ApiBase::parameterNotEmpty (   $x)
private

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

Parameters
$xobject Parameter to check is not null/false
Returns
bool

Definition at line 921 of file ApiBase.php.

◆ parseErrors()

ApiBase::parseErrors (   $errors)

Parses a list of errors into a standardised format.

Parameters
array$errorsList of errors. Items can be in the for array( key, param1, param2, ... ) or array( 'code' => ..., 'info' => ... )
Returns
array Parsed list of errors with items in the form array( 'code' => ..., 'info' => ... )

Definition at line 2204 of file ApiBase.php.

Referenced by ApiParamInfo\getClassInfo().

◆ parseMsg()

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 2002 of file ApiBase.php.

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

◆ parseMultiValue()

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)
$valuemixed The value being parsed
bool$allowMultipleCan $value contain more than one value separated by '|'?
$allowedValuesmixed An array of values to check against. If null, all values are accepted.
Returns
mixed (allowMultiple ? an_array_of_values : a_single_value)

Definition at line 1209 of file ApiBase.php.

◆ profileDBIn()

◆ profileDBOut()

◆ profileIn()

◆ profileOut()

◆ requireAtLeastOneParameter()

ApiBase::requireAtLeastOneParameter (   $params)

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

Since
1.23
Parameters
array$paramsUser provided set of parameters
string... List of parameter names to check

Definition at line 830 of file ApiBase.php.

◆ requireMaxOneParameter()

ApiBase::requireMaxOneParameter (   $params)

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

Parameters
$paramsarray

Definition at line 789 of file ApiBase.php.

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

◆ requireOnlyOneParameter()

ApiBase::requireOnlyOneParameter (   $params)

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

Parameters
array$paramsof parameter names

Definition at line 742 of file ApiBase.php.

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

◆ safeProfileOut()

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 2257 of file ApiBase.php.

◆ setWarning()

ApiBase::setWarning (   $warning)

Set warning section for this module.

Users should monitor this section to notice any changes in API. Multiple calls to this function will result in the warning messages being separated by newlines

Parameters
string$warningWarning message

Definition at line 245 of file ApiBase.php.

Referenced by ApiResult\addValue(), ApiTokens\execute(), ApiOptions\execute(), ApiPurge\execute(), ApiQueryDisabled\execute(), ApiParse\execute(), ApiQueryUsers\execute(), ApiQueryRevisions\execute(), ApiPageSet\executeInternal(), ApiQueryInfo\extractPageInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiQueryRevisions\extractRowInfo(), ApiParse\languagesHtml(), ApiQueryImageInfo\mergeThumbParams(), ApiMain\printResult(), ApiMain\reportUnusedParams(), ApiQueryImages\run(), ApiQueryCategories\run(), and ApiQueryLinks\run().

◆ setWatch()

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'
$titleObjTitle the article's title to change
string$userOptionThe user option to consider when $watch=preferences

Definition at line 972 of file ApiBase.php.

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

◆ shouldCheckMaxlag()

ApiBase::shouldCheckMaxlag ( )

Indicates if this module needs maxlag to be checked.

Returns
bool

Reimplemented in ApiQuery, and ApiHelp.

Definition at line 2038 of file ApiBase.php.

◆ truncateArray()

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 1361 of file ApiBase.php.

◆ validateLimit()

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

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
$enforceLimitsBoolean Whether to enforce (die) if value is outside limits

Definition at line 1273 of file ApiBase.php.

Referenced by ApiQueryDeletedrevs\execute(), ApiQueryRevisions\execute(), and ApiQueryBacklinks\run().

◆ validateTimestamp()

ApiBase::validateTimestamp (   $value,
  $encParamName 
)

Validate and normalize of parameters of type 'timestamp'.

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

Definition at line 1311 of file ApiBase.php.

◆ validateUser()

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 1329 of file ApiBase.php.

◆ warnOrDie()

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

Adds a warning to the output, else dies.

Parameters
$msgString Message to show as a warning, or error message if dying
$enforceLimitsBoolean Whether this is an enforce (die)

Definition at line 1347 of file ApiBase.php.

Member Data Documentation

◆ $mDBTime

ApiBase::$mDBTime = 0

Definition at line 2281 of file ApiBase.php.

◆ $mDBTimeIn

ApiBase::$mDBTimeIn = 0
private

Profiling: database execution time.

Definition at line 2281 of file ApiBase.php.

◆ $messageMap

ApiBase::$messageMap
static

Array that maps message keys to error messages.

$1 and friends are replaced.

Definition at line 1449 of file ApiBase.php.

◆ $mMainModule

ApiBase::$mMainModule
private

Definition at line 90 of file ApiBase.php.

◆ $mModuleName

ApiBase::$mModuleName

Definition at line 90 of file ApiBase.php.

◆ $mModulePrefix

ApiBase::$mModulePrefix

Definition at line 90 of file ApiBase.php.

◆ $mModuleTime

ApiBase::$mModuleTime = 0

Definition at line 2221 of file ApiBase.php.

◆ $mParamCache

ApiBase::$mParamCache = array()
private

Definition at line 92 of file ApiBase.php.

◆ $mSlaveDB

ApiBase::$mSlaveDB = null
private

Definition at line 91 of file ApiBase.php.

◆ $mTimeIn

ApiBase::$mTimeIn = 0
private

Profiling: total module execution time.

Definition at line 2221 of file ApiBase.php.

◆ GET_VALUES_FOR_HELP

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 88 of file ApiBase.php.

Referenced by ApiQueryLogEvents\getAllowedParams(), ApiPageSet\getAllowedParams(), and ApiParamInfo\getClassInfo().

◆ LIMIT_BIG1

const ApiBase::LIMIT_BIG1 = 500

Definition at line 78 of file ApiBase.php.

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

◆ LIMIT_BIG2

const ApiBase::LIMIT_BIG2 = 5000

Definition at line 79 of file ApiBase.php.

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

◆ LIMIT_SML1

const ApiBase::LIMIT_SML1 = 50

◆ LIMIT_SML2

const ApiBase::LIMIT_SML2 = 500

◆ PARAM_ALLOW_DUPLICATES

const ApiBase::PARAM_ALLOW_DUPLICATES = 6

◆ PARAM_DEPRECATED

◆ PARAM_DFLT

const ApiBase::PARAM_DFLT = 0

Definition at line 46 of file ApiBase.php.

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

◆ PARAM_ISMULTI

const ApiBase::PARAM_ISMULTI = 1

Definition at line 48 of file ApiBase.php.

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

◆ PARAM_MAX

const ApiBase::PARAM_MAX = 3

Definition at line 52 of file ApiBase.php.

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

◆ PARAM_MAX2

const ApiBase::PARAM_MAX2 = 4

Definition at line 54 of file ApiBase.php.

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

◆ PARAM_MIN

const ApiBase::PARAM_MIN = 5

Definition at line 56 of file ApiBase.php.

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

◆ PARAM_RANGE_ENFORCE

const ApiBase::PARAM_RANGE_ENFORCE = 9
Since
1.17

Definition at line 66 of file ApiBase.php.

◆ PARAM_REQUIRED

◆ PARAM_TYPE

const ApiBase::PARAM_TYPE = 2

Definition at line 50 of file ApiBase.php.

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

◆ PROP_LIST

◆ PROP_NULLABLE

◆ PROP_ROOT

const ApiBase::PROP_ROOT = 'ROOT'

◆ PROP_TYPE


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