MediaWiki
master
|
This abstract class implements many basic API functions, and is the base of all API classes. More...
Public Attributes | |
const | PARAM_RANGE_ENFORCE = 'api-param-range-enforce' |
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE More... | |
Old constants for ::getAllowedParams() arrays | |
const | PARAM_DFLT = ParamValidator::PARAM_DEFAULT |
const | PARAM_ISMULTI = ParamValidator::PARAM_ISMULTI |
const | PARAM_TYPE = ParamValidator::PARAM_TYPE |
const | PARAM_MAX = IntegerDef::PARAM_MAX |
const | PARAM_MAX2 = IntegerDef::PARAM_MAX2 |
const | PARAM_MIN = IntegerDef::PARAM_MIN |
const | PARAM_ALLOW_DUPLICATES = ParamValidator::PARAM_ALLOW_DUPLICATES |
const | PARAM_DEPRECATED = ParamValidator::PARAM_DEPRECATED |
const | PARAM_REQUIRED = ParamValidator::PARAM_REQUIRED |
const | PARAM_SUBMODULE_MAP = SubmoduleDef::PARAM_SUBMODULE_MAP |
const | PARAM_SUBMODULE_PARAM_PREFIX = SubmoduleDef::PARAM_SUBMODULE_PARAM_PREFIX |
const | PARAM_ALL = ParamValidator::PARAM_ALL |
const | PARAM_EXTRA_NAMESPACES = NamespaceDef::PARAM_EXTRA_NAMESPACES |
const | PARAM_SENSITIVE = ParamValidator::PARAM_SENSITIVE |
const | PARAM_DEPRECATED_VALUES = EnumDef::PARAM_DEPRECATED_VALUES |
const | PARAM_ISMULTI_LIMIT1 = ParamValidator::PARAM_ISMULTI_LIMIT1 |
const | PARAM_ISMULTI_LIMIT2 = ParamValidator::PARAM_ISMULTI_LIMIT2 |
const | PARAM_MAX_BYTES = StringDef::PARAM_MAX_BYTES |
const | PARAM_MAX_CHARS = StringDef::PARAM_MAX_CHARS |
API-specific constants for ::getAllowedParams() arrays | |
const | PARAM_HELP_MSG = 'api-param-help-msg' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. More... | |
const | PARAM_HELP_MSG_APPEND = 'api-param-help-msg-append' |
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this parameter. More... | |
const | PARAM_HELP_MSG_INFO = 'api-param-help-msg-info' |
(array) Specify additional information tags for the parameter. More... | |
const | PARAM_VALUE_LINKS = 'api-param-value-links' |
Deprecated and unused. More... | |
const | PARAM_HELP_MSG_PER_VALUE = 'api-param-help-msg-per-value' |
((string|array|Message)[]) When PARAM_TYPE is an array, or 'string' with PARAM_ISMULTI, this is an array mapping parameter values to help message specifiers (to be passed to ApiBase::makeMessage()) about those values. More... | |
const | PARAM_TEMPLATE_VARS = 'param-template-vars' |
(array) Indicate that this is a templated parameter, and specify replacements. More... | |
const | ALL_DEFAULT_STRING = '*' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. More... | |
const | LIMIT_BIG1 = 500 |
Fast query, standard limit. More... | |
const | LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit. More... | |
const | LIMIT_SML1 = 50 |
Slow query, standard limit. More... | |
const | LIMIT_SML2 = 500 |
Slow query, apihighlimits limit. More... | |
const | GET_VALUES_FOR_HELP = 1 |
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thorough. More... | |
string | $mModulePrefix |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. More... | |
__construct (ApiMain $mainModule, $moduleName, $modulePrefix='') | |
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... | |
getConditionalRequestData ( $condition) | |
Returns data for HTTP conditional request mechanisms. 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... | |
getErrorFormatter () | |
getContinuationManager () | |
setContinuationManager (ApiContinuationManager $manager=null) | |
getDB () | |
Gets a default replica DB connection object. More... | |
getPermissionManager () | |
Obtain a PermissionManager instance that subclasses may use in their authorization checks. More... | |
getHookContainer () | |
Get a HookContainer, for running extension hooks or for hook metadata. More... | |
getHookRunner () | |
Get an ApiHookRunner for running core API hooks. More... | |
Parameter handling | |
dynamicParameterDocumentation () | |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams(). More... | |
encodeParamName ( $paramName) | |
This method mangles parameter name based on the prefix supplied to the constructor. More... | |
extractRequestParams ( $options=[]) | |
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... | |
requirePostedParameters ( $params, $prefix='prefix') | |
Die if any of the specified parameters were found in the query part of the URL rather than the post body. More... | |
getTitleOrPageId ( $params, $load=false) | |
Get a WikiPage object from a title or pageid param, if possible. More... | |
getTitleFromTitleOrPageId ( $params) | |
Get a Title object from a title or pageid param, if possible. More... | |
handleParamNormalization ( $paramName, $value, $rawValue) | |
Handle when a parameter was Unicode-normalized. More... | |
validateToken ( $token, array $params) | |
Validate the supplied token. More... | |
getParameter ( $paramName, $parseLimit=true) | |
Get a value for the given parameter. More... | |
getParameterFromSettings ( $name, $settings, $parseLimit) | |
Using the settings determine the value for the given parameter. More... | |
Utility methods | |
getWatchlistUser ( $params) | |
Gets the user for whom to get the watchlist. More... | |
errorArrayToStatus (array $errors, User $user=null) | |
Turn an array of message keys or key+param arrays into a Status. More... | |
addBlockInfoToStatus (StatusValue $status, Authority $user=null) | |
Add block info to block messages in a Status. More... | |
useTransactionalTimeLimit () | |
Call wfTransactionalTimeLimit() if this request was POSTed. More... | |
filterIDs ( $fields, array $ids) | |
Filter out-of-range values from a list of positive integer IDs. More... | |
static | makeMessage ( $msg, IContextSource $context, array $params=null) |
Create a Message from a string or array. More... | |
static | clearCacheForTest () |
Reset static caches of database state. More... | |
Warning and error reporting | |
addWarning ( $msg, $code=null, $data=null) | |
Add a warning for this module. More... | |
addDeprecation ( $msg, $feature, $data=[]) | |
Add a deprecation warning for this module. More... | |
addError ( $msg, $code=null, $data=null) | |
Add an error for this module without aborting. More... | |
addMessagesFromStatus (StatusValue $status, $types=[ 'warning', 'error'], array $filter=[]) | |
Add warnings and/or errors from a Status. More... | |
dieWithError ( $msg, $code=null, $data=null, $httpCode=0) | |
Abort execution with an error. More... | |
dieWithException (Throwable $exception, array $options=[]) | |
Abort execution with an error derived from a throwable. More... | |
dieBlocked (Block $block) | |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info. More... | |
dieStatus (StatusValue $status) | |
Throw an ApiUsageException based on the Status object. More... | |
dieReadOnly () | |
Helper function for readonly errors. More... | |
checkUserRightsAny ( $rights, $user=null) | |
Helper function for permission-denied errors. More... | |
checkTitleUserPermissions ( $pageIdentity, $actions, array $options=[]) | |
Helper function for permission-denied errors. More... | |
dieWithErrorOrDebug ( $msg, $code=null, $data=null, $httpCode=null) | |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true. More... | |
logFeatureUsage ( $feature) | |
Write logging information for API features to a debug log, for usage analysis. More... | |
parseContinueParamOrDie (string $continue, array $types) | |
Parse the 'continue' parameter in the usual format and validate the types of each part, or die with the 'badcontinue' error if the format, types, or number of parts is wrong. More... | |
dieContinueUsageIf ( $condition) | |
Die with the 'badcontinue' error. More... | |
static | dieDebug ( $method, $message) |
Internal code errors should be reported with this method. More... | |
Help message generation | |
getFinalSummary () | |
Get final module summary. More... | |
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, array &$tocData) | |
Called from ApiHelp before the pieces are joined together and returned. More... | |
getSummaryMessage () | |
Return the summary message. More... | |
getExtendedDescription () | |
Return the extended help text message. More... | |
getHelpFlags () | |
Generates the list of flags for the help screen and for action=paraminfo. More... | |
getModuleSourceInfo () | |
Returns information about the source of this module, if known. More... | |
Additional Inherited Members | |
![]() | |
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... | |
getActionName () | |
Get the action name for the current web request. More... | |
getAuthority () | |
getConfig () | |
getContext () | |
Get the base IContextSource object. More... | |
getCsrfTokenSet () | |
Get a repository to obtain and match CSRF tokens. More... | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
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.
Self-documentation: code to allow the API to document its own state
Definition at line 59 of file ApiBase.php.
ApiBase::__construct | ( | ApiMain | $mainModule, |
$moduleName, | |||
$modulePrefix = '' |
|||
) |
ApiMain | $mainModule | |
string | $moduleName | Name of this module |
string | $modulePrefix | Prefix to use for parameter names |
Reimplemented in ApiOpenSearchFormatJson.
Definition at line 277 of file ApiBase.php.
References ContextSource\getContext(), isMain(), and ContextSource\setContext().
ApiBase::addBlockInfoToStatus | ( | StatusValue | $status, |
Authority | $user = null |
||
) |
Add block info to block messages in a Status.
StatusValue | $status | |
Authority | null | $user |
Definition at line 1282 of file ApiBase.php.
References ApiMessage\create(), getAuthority(), StatusValue\hasMessage(), and StatusValue\replaceMessage().
ApiBase::addDeprecation | ( | $msg, | |
$feature, | |||
$data = [] |
|||
) |
Add a deprecation warning for this module.
A combination of $this->addWarning() and $this->logFeatureUsage()
string | array | Message | $msg | See ApiErrorFormatter::addWarning() |
string | null | $feature | See ApiBase::logFeatureUsage() |
array | null | $data | See ApiErrorFormatter::addWarning() |
Definition at line 1392 of file ApiBase.php.
Referenced by ApiExpandTemplates\execute(), ApiLogin\execute(), ApiQueryDeletedrevs\execute(), and ApiQueryRevisionsBase\parseParameters().
ApiBase::addError | ( | $msg, | |
$code = null , |
|||
$data = null |
|||
) |
Add an error for this module without aborting.
If $msg is not an ApiMessage, the message code will be derived from the message key by stripping any "apiwarn-" or "apierror-" prefix.
string | array | Message | $msg | See ApiErrorFormatter::addError() |
string | null | $code | See ApiErrorFormatter::addError() |
array | null | $data | See ApiErrorFormatter::addError() |
Definition at line 1425 of file ApiBase.php.
ApiBase::addMessagesFromStatus | ( | StatusValue | $status, |
$types = [ 'warning' , |
|||
'error'] | , | ||
array | $filter = [] |
||
) |
Add warnings and/or errors from a Status.
StatusValue | $status | |
string[] | $types | 'warning' and/or 'error' |
string[] | $filter | Message keys to filter out (since 1.33) |
Definition at line 1438 of file ApiBase.php.
Referenced by ApiUndelete\execute().
ApiBase::addWarning | ( | $msg, | |
$code = null , |
|||
$data = null |
|||
) |
Add a warning for this module.
Users should monitor this section to notice any changes in API. Multiple calls to this function will result in multiple warning messages.
If $msg is not an ApiMessage, the message code will be derived from the message key by stripping any "apiwarn-" or "apierror-" prefix.
string | array | Message | $msg | See ApiErrorFormatter::addWarning() |
string | null | $code | See ApiErrorFormatter::addWarning() |
array | null | $data | See ApiErrorFormatter::addWarning() |
Definition at line 1378 of file ApiBase.php.
Referenced by ApiFormatXml\addXslt(), ApiCheckToken\execute(), ApiComparePages\execute(), ApiDelete\execute(), ApiExpandTemplates\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiPurge\execute(), ApiQueryDisabled\execute(), ApiQueryLanguageinfo\execute(), ApiQueryTokens\execute(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryAllDeletedRevisions\run().
ApiBase::checkTitleUserPermissions | ( | $pageIdentity, | |
$actions, | |||
array | $options = [] |
||
) |
Helper function for permission-denied errors.
PageIdentity | LinkTarget | $pageIdentity | deprecated passing LinkTarget since 1.36 |
string | string[] | $actions | |
array | $options | Additional options |
ApiUsageException | if the user doesn't have all of the rights. |
Definition at line 1592 of file ApiBase.php.
References getAuthority(), getUser(), and wfDeprecatedMsg().
Referenced by ApiEditPage\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiProtect\execute(), and ApiSetPageLanguage\execute().
ApiBase::checkUserRightsAny | ( | $rights, | |
$user = null |
|||
) |
Helper function for permission-denied errors.
string | string[] | $rights | |
User | null | $user | deprecated since 1.36 |
ApiUsageException | if the user doesn't have any of the rights. The error message is based on $rights[0]. |
Definition at line 1566 of file ApiBase.php.
References getAuthority(), and wfDeprecatedMsg().
Referenced by ApiBlock\execute(), ApiChangeContentModel\execute(), ApiOptions\execute(), ApiQueryDeletedrevs\execute(), ApiRevisionDelete\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiTag\execute(), and ApiWatch\execute().
|
static |
Reset static caches of database state.
Definition at line 1316 of file ApiBase.php.
ApiBase::dieBlocked | ( | Block | $block | ) |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info.
Block | $block | The block used to generate the ApiUsageException |
ApiUsageException | always |
Definition at line 1489 of file ApiBase.php.
References MediaWiki\Block\Block\getType(), and MediaWiki\Block\Block\isSitewide().
Referenced by ApiUpload\checkPermissions(), ApiEditPage\execute(), ApiPurge\execute(), ApiRevisionDelete\execute(), ApiTag\execute(), ApiUndelete\execute(), and ApiUserrights\execute().
|
protected |
Die with the 'badcontinue' error.
This call is common enough to make it into the base method.
bool | $condition | Will only die if this value is true |
ApiUsageException |
Definition at line 1688 of file ApiBase.php.
Referenced by ApiQueryInfo\execute(), ApiQueryUserContribs\execute(), and ApiQueryRandom\run().
|
staticprotected |
Internal code errors should be reported with this method.
string | $method | Method or function name |
string | $message | Error message |
MWException | always |
Definition at line 1701 of file ApiBase.php.
Referenced by ApiQueryLinks\__construct(), ApiQueryAllLinks\__construct(), ApiQueryBase\addJoinConds(), ApiQueryBase\addTables(), ApiFormatFeedWrapper\execute(), ApiFormatJson\execute(), ApiFormatPhp\execute(), ApiFormatRaw\execute(), ApiLogin\execute(), ApiQuerySiteinfo\execute(), ApiUpload\execute(), ApiOpenSearch\getCustomPrinter(), ApiFormatRaw\getMimeType(), ApiFormatFeedWrapper\initPrinter(), ApiOpenSearch\populateResult(), ApiQueryRecentChanges\run(), ApiQueryDeletedRevisions\run(), and ApiQueryRevisions\run().
ApiBase::dieReadOnly | ( | ) |
Helper function for readonly errors.
ApiUsageException | always |
Definition at line 1550 of file ApiBase.php.
Referenced by ApiEditPage\execute().
ApiBase::dieStatus | ( | StatusValue | $status | ) |
Throw an ApiUsageException based on the Status object.
StatusValue | $status |
ApiUsageException | always |
Definition at line 1521 of file ApiBase.php.
References StatusValue\getErrorsByType(), StatusValue\isGood(), StatusValue\newGood(), and StatusValue\setOK().
Referenced by ApiUpload\checkPermissions(), ApiUpload\dieStatusWithCode(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiChangeContentModel\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetPageLanguage\execute(), ApiTag\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiUpload\performUpload(), and ApiQueryRevisions\run().
ApiBase::dieWithError | ( | $msg, | |
$code = null , |
|||
$data = null , |
|||
$httpCode = 0 |
|||
) |
Abort execution with an error.
If $msg is not an ApiMessage, the message code will be derived from the message key by stripping any "apiwarn-" or "apierror-" prefix.
string | array | Message | $msg | See ApiErrorFormatter::addError() |
string | null | $code | See ApiErrorFormatter::addError() |
array | null | $data | See ApiErrorFormatter::addError() |
int | $httpCode | HTTP error code to use |
ApiUsageException | always |
Definition at line 1460 of file ApiBase.php.
References ApiUsageException\newWithMessage().
Referenced by ApiQuerySiteinfo\appendDbReplLagInfo(), ApiQueryImageInfo\checkParameterNormalise(), ApiUpload\checkPermissions(), ApiUpload\checkVerification(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiChangeContentModel\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiDelete\execute(), ApiDisabled\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogout\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOpenSearchFormatJson\execute(), ApiOptions\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryImageInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryStashImageInfo\execute(), ApiQueryUserContribs\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiQueryAllImages\executeGenerator(), ApiQueryAllPages\executeGenerator(), getModuleFromPath(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryRevisionsBase\parseParameters(), ApiQueryBase\parsePrefixedTitlePart(), ApiUpload\performUpload(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryRecentChanges\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\run(), ApiUpload\selectUploadModule(), ApiQueryBase\titlePartToKey(), ApiFileRevert\validateParameters(), and ApiUpload\verifyUpload().
ApiBase::dieWithErrorOrDebug | ( | $msg, | |
$code = null , |
|||
$data = null , |
|||
$httpCode = null |
|||
) |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true.
Otherwise behaves exactly as self::dieWithError().
string | array | Message | $msg | |
string | null | $code | |
array | null | $data | |
int | null | $httpCode |
ApiUsageException |
Definition at line 1631 of file ApiBase.php.
ApiBase::dieWithException | ( | Throwable | $exception, |
array | $options = [] |
||
) |
Abort execution with an error derived from a throwable.
Throwable | $exception | See ApiErrorFormatter::getMessageFromException() |
array | $options | See ApiErrorFormatter::getMessageFromException() |
ApiUsageException | always |
Definition at line 1473 of file ApiBase.php.
Referenced by ApiEditPage\execute(), ApiImport\execute(), ApiQueryStashImageInfo\execute(), and ApiStashEdit\execute().
ApiBase::dynamicParameterDocumentation | ( | ) |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams().
Reimplemented in ApiLinkAccount, ApiClientLogin, ApiChangeAuthenticationData, and ApiAMCreateAccount.
Definition at line 740 of file ApiBase.php.
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
string | string[] | $paramName | Parameter name |
Reimplemented in ApiQueryGeneratorBase.
Definition at line 751 of file ApiBase.php.
Referenced by ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiQueryAllMessages\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLanguageinfo\execute(), ApiQueryLogEvents\execute(), ApiQueryUserContribs\execute(), ApiSetNotificationTimestamp\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), MediaWiki\Api\Validator\ApiParamValidator\getValue(), and MediaWiki\Api\Validator\ApiParamValidator\validateValue().
ApiBase::errorArrayToStatus | ( | array | $errors, |
User | $user = null |
||
) |
Turn an array of message keys or key+param arrays into a Status.
array | $errors | |
User | null | $user |
Definition at line 1254 of file ApiBase.php.
References ApiMessage\create(), getUser(), and StatusValue\newGood().
Referenced by ApiPatrol\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 ApiWatch, ApiValidatePassword, ApiUserrights, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiStashEdit, ApiSetPageLanguage, ApiSetNotificationTimestamp, ApiRsd, ApiRollback, ApiRevisionDelete, ApiResetPassword, ApiRemoveAuthenticationData, ApiQueryWatchlistRaw, ApiQueryWatchlist, ApiQueryUsers, ApiQueryUserInfo, ApiQueryUserContribs, ApiQueryTokens, ApiQueryTags, ApiQueryStashImageInfo, ApiQuerySiteinfo, ApiQuerySearch, ApiQueryRevisionsBase, ApiQueryRecentChanges, ApiQueryRandom, ApiQueryQueryPage, ApiQueryProtectedTitles, ApiQueryPrefixSearch, ApiQueryPagesWithProp, ApiQueryPageProps, ApiQueryPagePropNames, ApiQueryMyStashedFiles, ApiQueryLogEvents, ApiQueryLinks, ApiQueryLanguageinfo, ApiQueryLangLinks, ApiQueryLangBacklinks, ApiQueryIWLinks, ApiQueryIWBacklinks, ApiQueryInfo, ApiQueryImages, ApiQueryImageInfo, ApiQueryFileRepoInfo, ApiQueryFilearchive, ApiQueryExtLinksUsage, ApiQueryExternalLinks, ApiQueryDuplicateFiles, ApiQueryDisabled, ApiQueryDeletedrevs, ApiQueryContributors, ApiQueryCategoryMembers, ApiQueryCategoryInfo, ApiQueryCategories, ApiQueryBlocks, ApiQueryBacklinksprop, ApiQueryBacklinks, ApiQueryAuthManagerInfo, ApiQueryAllUsers, ApiQueryAllPages, ApiQueryAllMessages, ApiQueryAllLinks, ApiQueryAllImages, ApiQueryAllCategories, ApiQuery, ApiPurge, ApiProtect, ApiPatrol, ApiParse, ApiParamInfo, ApiPageSet, ApiOptions, ApiOpenSearchFormatJson, ApiOpenSearch, ApiMove, ApiMergeHistory, ApiManageTags, ApiMain, ApiLogout, ApiLogin, ApiLinkAccount, ApiImport, ApiImageRotate, ApiHelp, ApiFormatXml, ApiFormatRaw, ApiFormatPhp, ApiFormatNone, ApiFormatJson, ApiFormatFeedWrapper, ApiFileRevert, ApiFeedWatchlist, ApiFeedRecentChanges, ApiFeedContributions, ApiExpandTemplates, ApiEmailUser, ApiEditPage, ApiDisabled, ApiDelete, ApiCSPReport, ApiComparePages, ApiClientLogin, ApiClearHasMsg, ApiCheckToken, ApiChangeContentModel, ApiChangeAuthenticationData, ApiBlock, and ApiAMCreateAccount.
ApiBase::extractRequestParams | ( | $options = [] | ) |
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.
bool | array | $options | If a boolean, uses that as the value for 'parseLimit'
|
Definition at line 773 of file ApiBase.php.
References wfEscapeWikiText().
Referenced by ApiPageSet\__construct(), ApiContinuationManager\__construct(), ApiAuthManagerHelper\__construct(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendLanguages(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiChangeContentModel\execute(), ApiCheckToken\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiFileRevert\execute(), ApiFormatJson\execute(), ApiFormatPhp\execute(), ApiFormatXml\execute(), ApiHelp\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogin\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOpenSearch\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQuery\execute(), ApiQueryAllMessages\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryContributors\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryImageInfo\execute(), ApiQueryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryPageProps\execute(), ApiQuerySiteinfo\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiQueryUserContribs\execute(), ApiQueryUserInfo\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getFormat(), ApiFormatJson\getMimeType(), ApiQuery\isReadMode(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\run(), and ApiQueryRandom\runQuery().
|
protected |
Filter out-of-range values from a list of positive integer IDs.
string[][] | $fields | Array of pairs of table and field to check |
(string|int)[] | $ids IDs to filter. Strings in the array are expected to be stringified ints. |
Definition at line 1331 of file ApiBase.php.
References getDB().
Referenced by ApiQueryBase\addWhereIDsFld().
|
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.
Reimplemented in ApiValidatePassword, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiStashEdit, ApiSetPageLanguage, ApiRollback, ApiRevisionDelete, ApiResetPassword, ApiRemoveAuthenticationData, ApiQueryWatchlistRaw, ApiQueryWatchlist, ApiQueryUsers, ApiQueryUserInfo, ApiQueryUserContribs, ApiQueryTokens, ApiQueryTags, ApiQueryStashImageInfo, ApiQuerySiteinfo, ApiQuerySearch, ApiQueryRevisionsBase, ApiQueryRevisions, ApiQueryRecentChanges, ApiQueryRandom, ApiQueryQueryPage, ApiQueryProtectedTitles, ApiQueryPrefixSearch, ApiQueryPagesWithProp, ApiQueryPageProps, ApiQueryPagePropNames, ApiQueryMyStashedFiles, ApiQueryLinks, ApiQueryLanguageinfo, ApiQueryLangLinks, ApiQueryLangBacklinks, ApiQueryIWLinks, ApiQueryIWBacklinks, ApiQueryInfo, ApiQueryImages, ApiQueryImageInfo, ApiQueryFileRepoInfo, ApiQueryFilearchive, ApiQueryExtLinksUsage, ApiQueryExternalLinks, ApiQueryDuplicateFiles, ApiQueryDeletedrevs, ApiQueryDeletedRevisions, ApiQueryCategoryMembers, ApiQueryCategoryInfo, ApiQueryCategories, ApiQueryBlocks, ApiQueryBacklinksprop, ApiQueryBacklinks, ApiQueryAuthManagerInfo, ApiQueryAllRevisions, ApiQueryAllPages, ApiQueryAllMessages, ApiQueryAllLinks, ApiQueryAllImages, ApiQueryAllDeletedRevisions, ApiQueryAllCategories, ApiProtect, ApiPatrol, ApiParse, ApiParamInfo, ApiOptions, ApiOpenSearch, ApiMove, ApiMergeHistory, ApiManageTags, ApiMain, ApiLogin, ApiLinkAccount, ApiImport, ApiHelp, ApiFormatXml, ApiFormatPhp, ApiFormatJson, ApiFormatBase, ApiFileRevert, ApiFeedRecentChanges, ApiFeedContributions, ApiExpandTemplates, ApiEmailUser, ApiEditPage, ApiDelete, ApiCSPReport, ApiComparePages, ApiClientLogin, ApiCheckToken, ApiChangeContentModel, ApiChangeAuthenticationData, ApiBlock, and ApiAMCreateAccount.
Definition at line 372 of file ApiBase.php.
ApiBase::getConditionalRequestData | ( | $condition | ) |
Returns data for HTTP conditional request mechanisms.
string | $condition | Condition being queried:
|
Definition at line 492 of file ApiBase.php.
ApiBase::getContinuationManager | ( | ) |
Reimplemented in ApiMain.
Definition at line 671 of file ApiBase.php.
References getMain().
Referenced by ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllRevisions\run(), ApiQueryBase\setContinueEnumParameter(), and ApiQueryGeneratorBase\setContinueEnumParameter().
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.
Reimplemented in ApiRsd, ApiQuery, ApiOpenSearch, ApiHelp, ApiFeedWatchlist, ApiFeedRecentChanges, and ApiFeedContributions.
Definition at line 329 of file ApiBase.php.
|
protected |
Gets a default replica DB connection object.
Reimplemented in ApiQueryBase, ApiQueryAllImages, and ApiPageSet.
Definition at line 660 of file ApiBase.php.
References DB_REPLICA, and wfGetDB().
ApiBase::getErrorFormatter | ( | ) |
Reimplemented in ApiMain.
Definition at line 648 of file ApiBase.php.
References getMain().
Referenced by ApiChangeContentModel\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiManageTags\execute(), ApiMove\execute(), ApiProtect\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiValidatePassword\execute(), ApiQueryUserInfo\getCurrentUserInfo(), ApiUpload\handleStashException(), ApiMove\moveSubpages(), and ApiTag\processIndividual().
|
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.
Reimplemented in ApiWatch, ApiValidatePassword, ApiUserrights, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiSetPageLanguage, ApiSetNotificationTimestamp, ApiRsd, ApiRollback, ApiRevisionDelete, ApiResetPassword, ApiRemoveAuthenticationData, ApiQueryWatchlistRaw, ApiQueryWatchlist, ApiQueryUsers, ApiQueryUserInfo, ApiQueryUserContribs, ApiQueryTokens, ApiQueryTags, ApiQueryStashImageInfo, ApiQuerySiteinfo, ApiQuerySearch, ApiQueryRevisions, ApiQueryRecentChanges, ApiQueryRandom, ApiQueryQueryPage, ApiQueryProtectedTitles, ApiQueryPrefixSearch, ApiQueryPagesWithProp, ApiQueryPageProps, ApiQueryPagePropNames, ApiQueryMyStashedFiles, ApiQueryLogEvents, ApiQueryLinks, ApiQueryLanguageinfo, ApiQueryLangLinks, ApiQueryLangBacklinks, ApiQueryIWLinks, ApiQueryIWBacklinks, ApiQueryInfo, ApiQueryImages, ApiQueryImageInfo, ApiQueryFileRepoInfo, ApiQueryFilearchive, ApiQueryExtLinksUsage, ApiQueryExternalLinks, ApiQueryDuplicateFiles, ApiQueryDeletedrevs, ApiQueryDeletedRevisions, ApiQueryContributors, ApiQueryCategoryMembers, ApiQueryCategoryInfo, ApiQueryCategories, ApiQueryBlocks, ApiQueryBacklinksprop, ApiQueryBacklinks, ApiQueryAuthManagerInfo, ApiQueryAllUsers, ApiQueryAllRevisions, ApiQueryAllPages, ApiQueryAllMessages, ApiQueryAllLinks, ApiQueryAllImages, ApiQueryAllDeletedRevisions, ApiQueryAllCategories, ApiQuery, ApiPurge, ApiProtect, ApiPatrol, ApiParse, ApiParamInfo, ApiOptions, ApiOpenSearch, ApiMove, ApiMergeHistory, ApiManageTags, ApiMain, ApiLogout, ApiLogin, ApiLinkAccount, ApiImport, ApiImageRotate, ApiHelp, ApiFormatBase, ApiFileRevert, ApiFeedWatchlist, ApiFeedRecentChanges, ApiFeedContributions, ApiExpandTemplates, ApiEmailUser, ApiEditPage, ApiDelete, ApiComparePages, ApiClientLogin, ApiClearHasMsg, ApiCheckToken, ApiChangeContentModel, ApiChangeAuthenticationData, ApiBlock, and ApiAMCreateAccount.
Definition at line 345 of file ApiBase.php.
|
protected |
Return the extended help text message.
This is additional text to display at the top of the help section, below the summary.
Reimplemented in ApiSetPageLanguage, ApiResetPassword, ApiQueryDisabled, ApiLogin, and ApiDisabled.
Definition at line 1771 of file ApiBase.php.
ApiBase::getFinalDescription | ( | ) |
Get final module description, after hooks have had a chance to tweak it as needed.
Reimplemented in ApiLinkAccount, ApiClientLogin, and ApiAMCreateAccount.
Definition at line 1800 of file ApiBase.php.
References getContext().
ApiBase::getFinalParamDescription | ( | ) |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed.
Definition at line 1860 of file ApiBase.php.
References $path, and getContext().
ApiBase::getFinalParams | ( | $flags = 0 | ) |
Get final list of parameters, after hooks have had a chance to tweak it as needed.
int | $flags | Zero or more flags like GET_VALUES_FOR_HELP |
Definition at line 1829 of file ApiBase.php.
ApiBase::getFinalSummary | ( | ) |
Get final module summary.
Definition at line 1785 of file ApiBase.php.
References getContext().
|
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
Reimplemented in ApiQueryGeneratorBase.
Definition at line 2005 of file ApiBase.php.
ApiBase::getHelpUrls | ( | ) |
Return links to more detailed help pages about the module.
Reimplemented in ApiWatch, ApiValidatePassword, ApiUserrights, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiSetPageLanguage, ApiSetNotificationTimestamp, ApiRollback, ApiRevisionDelete, ApiResetPassword, ApiRemoveAuthenticationData, ApiQueryWatchlistRaw, ApiQueryWatchlist, ApiQueryUsers, ApiQueryUserInfo, ApiQueryUserContribs, ApiQueryTokens, ApiQueryTags, ApiQueryStashImageInfo, ApiQuerySiteinfo, ApiQuerySearch, ApiQueryRevisions, ApiQueryRecentChanges, ApiQueryRandom, ApiQueryQueryPage, ApiQueryProtectedTitles, ApiQueryPrefixSearch, ApiQueryPagesWithProp, ApiQueryPageProps, ApiQueryPagePropNames, ApiQueryMyStashedFiles, ApiQueryLogEvents, ApiQueryLinks, ApiQueryLangLinks, ApiQueryLangBacklinks, ApiQueryIWLinks, ApiQueryIWBacklinks, ApiQueryInfo, ApiQueryImages, ApiQueryImageInfo, ApiQueryFileRepoInfo, ApiQueryFilearchive, ApiQueryExtLinksUsage, ApiQueryExternalLinks, ApiQueryDuplicateFiles, ApiQueryDeletedrevs, ApiQueryDeletedRevisions, ApiQueryContributors, ApiQueryCategoryMembers, ApiQueryCategoryInfo, ApiQueryCategories, ApiQueryBlocks, ApiQueryBacklinksprop, ApiQueryBacklinks, ApiQueryAuthManagerInfo, ApiQueryAllUsers, ApiQueryAllRevisions, ApiQueryAllPages, ApiQueryAllMessages, ApiQueryAllLinks, ApiQueryAllImages, ApiQueryAllDeletedRevisions, ApiQueryAllCategories, ApiQuery, ApiPurge, ApiProtect, ApiPatrol, ApiParse, ApiParamInfo, ApiOptions, ApiOpenSearch, ApiMove, ApiMergeHistory, ApiManageTags, ApiLogout, ApiLogin, ApiLinkAccount, ApiImport, ApiHelp, ApiFormatBase, ApiFeedWatchlist, ApiExpandTemplates, ApiEmailUser, ApiEditPage, ApiDelete, ApiClientLogin, ApiClearHasMsg, ApiChangeContentModel, ApiChangeAuthenticationData, ApiBlock, and ApiAMCreateAccount.
Definition at line 355 of file ApiBase.php.
|
protected |
Get a HookContainer, for running extension hooks or for hook metadata.
Definition at line 704 of file ApiBase.php.
Referenced by ApiQueryBase\select().
|
protected |
Get an ApiHookRunner for running core API hooks.
Definition at line 719 of file ApiBase.php.
Referenced by ApiMain\__construct(), ApiQuery\__construct(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendStatistics(), ApiFormatBase\closePrinter(), ApiChangeAuthenticationData\execute(), ApiExpandTemplates\execute(), ApiLogin\execute(), ApiLogout\execute(), ApiOpenSearch\execute(), ApiOptions\execute(), ApiQuery\execute(), ApiRemoveAuthenticationData\execute(), ApiUndelete\execute(), ApiValidatePassword\execute(), ApiImport\getAllowedImportSources(), ApiRsd\getRsdApiList(), ApiMain\lacksSameOriginSecurity(), ApiQueryBase\processRow(), and ApiQueryBase\select().
ApiBase::getMain | ( | ) |
Get the main module.
Definition at line 522 of file ApiBase.php.
Referenced by ApiPageSet\__construct(), ApiContinuationManager\__construct(), ApiFormatBase\__construct(), ApiFormatJson\__construct(), ApiQueryBase\__construct(), ApiFormatBase\closePrinter(), ApiComparePages\execute(), ApiEditPage\execute(), ApiExpandTemplates\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiHelp\execute(), ApiOpenSearch\execute(), ApiParamInfo\execute(), ApiQuery\execute(), ApiQueryDeletedrevs\execute(), ApiUpload\execute(), ApiParamInfo\getAllowedParams(), getContinuationManager(), ApiFeedContributions\getCustomPrinter(), ApiFeedRecentChanges\getCustomPrinter(), ApiFeedWatchlist\getCustomPrinter(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getCustomPrinter(), ApiQuery\getCustomPrinter(), ApiRsd\getCustomPrinter(), getErrorFormatter(), getModuleFromPath(), getParent(), getResult(), ApiFormatBase\initPrinter(), ApiFormatRaw\initPrinter(), lacksSameOriginSecurity(), ApiQueryRevisionsBase\parseParameters(), ApiQueryRandom\run(), ApiUpload\selectUploadModule(), setContinuationManager(), and ApiFormatBase\setHttpStatus().
ApiBase::getModuleFromPath | ( | $path | ) |
Get a module from its module path.
string | $path |
ApiUsageException |
Definition at line 599 of file ApiBase.php.
References $path, dieWithError(), getMain(), and wfEscapeWikiText().
Referenced by ApiHelp\execute(), and ApiParamInfo\execute().
ApiBase::getModuleManager | ( | ) |
Get the module manager, or null if this module has no sub-modules.
Reimplemented in ApiQuery, and ApiMain.
Definition at line 315 of file ApiBase.php.
Referenced by ApiFormatBase\closePrinter(), and ApiParamInfo\execute().
ApiBase::getModuleName | ( | ) |
Get the name of the module being executed by this instance.
Definition at line 506 of file ApiBase.php.
Referenced by ApiPageSet\__construct(), ApiContinuationManager\__construct(), ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiBlock\execute(), ApiChangeContentModel\execute(), ApiCheckToken\execute(), ApiClearHasMsg\execute(), ApiComparePages\execute(), ApiCSPReport\execute(), ApiDelete\execute(), ApiDisabled\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFileRevert\execute(), ApiHelp\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQueryAllMessages\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryDisabled\execute(), ApiQueryFilearchive\execute(), ApiQueryLanguageinfo\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiQueryUserContribs\execute(), ApiQueryUserInfo\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiQueryBacklinksprop\getAllowedParams(), ApiFormatBase\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiQueryLanguageinfo\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiQueryAllLinks\getHelpUrls(), ApiQueryBacklinksprop\getHelpUrls(), getModulePath(), ApiAuthManagerHelper\logAuthenticationResult(), ApiQueryRevisionsBase\parseParameters(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryRandom\runQuery(), and ApiUpload\selectUploadModule().
ApiBase::getModulePath | ( | ) |
Get the path to this module.
Definition at line 581 of file ApiBase.php.
References getModuleName(), getParent(), and isMain().
Referenced by ApiUsageException\__construct(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiQueryLanguageinfo\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), and ApiHelp\getHelp().
ApiBase::getModulePrefix | ( | ) |
Get parameter prefix (usually two letters or an empty string).
Definition at line 514 of file ApiBase.php.
References $mModulePrefix.
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryImageInfo\execute(), ApiQueryStashImageInfo\execute(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryLanguageinfo\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllDeletedRevisions\run(), and ApiQueryRevisions\run().
|
protected |
Returns information about the source of this module, if known.
Returned array is an array with the following keys:
Definition at line 2038 of file ApiBase.php.
References $ext, $path, SpecialVersion\getCredits(), and ExtensionRegistry\getInstance().
|
protected |
Get a value for the given parameter.
string | $paramName | Parameter name |
bool | $parseLimit | See extractRequestParams() |
Definition at line 894 of file ApiBase.php.
Referenced by ApiFormatRaw\__construct(), ApiQuerySiteinfo\appendSkins(), ApiCSPReport\execute(), ApiFeedRecentChanges\execute(), ApiQueryLanguageinfo\execute(), ApiOpenSearch\getCustomPrinter(), ApiQuery\getCustomPrinter(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), and ApiQueryRevisions\run().
|
protected |
Using the settings determine the value for the given parameter.
string | $name | Parameter name |
array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
bool | $parseLimit | Whether to parse and validate 'limit' parameters |
Reimplemented in ApiFormatBase.
Definition at line 1114 of file ApiBase.php.
ApiBase::getParent | ( | ) |
Get the parent of this module.
Reimplemented in ApiQueryBase.
Definition at line 541 of file ApiBase.php.
References getMain(), and isMain().
Referenced by getModulePath().
|
protected |
Obtain a PermissionManager instance that subclasses may use in their authorization checks.
Definition at line 694 of file ApiBase.php.
Referenced by ApiProtect\execute(), ApiRevisionDelete\execute(), ApiQueryAllUsers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryUserInfo\getCurrentUserInfo(), and ApiTag\processIndividual().
ApiBase::getResult | ( | ) |
Get the result object.
Reimplemented in ApiMain.
Definition at line 637 of file ApiBase.php.
References getMain().
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQuerySiteinfo\appendDbReplLagInfo(), ApiQuerySiteinfo\appendDefaultOptions(), ApiQuerySiteinfo\appendExtensions(), ApiQuerySiteinfo\appendExtensionTags(), ApiQuerySiteinfo\appendFileExtensions(), ApiQuerySiteinfo\appendFunctionHooks(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendInstalledLibraries(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendLanguages(), ApiQuerySiteinfo\appendLanguageVariants(), ApiQuerySiteinfo\appendMagicWords(), ApiQuerySiteinfo\appendNamespaceAliases(), ApiQuerySiteinfo\appendNamespaces(), ApiQuerySiteinfo\appendProtocols(), ApiQuerySiteinfo\appendRestrictions(), ApiQuerySiteinfo\appendRightsInfo(), ApiQuerySiteinfo\appendSkins(), ApiQuerySiteinfo\appendSpecialPageAliases(), ApiQuerySiteinfo\appendStatistics(), ApiQuerySiteinfo\appendSubscribedHooks(), ApiQuerySiteinfo\appendUploadDialog(), ApiQuerySiteinfo\appendUserGroups(), ApiQuerySiteinfo\appendVariables(), ApiFormatRaw\closePrinter(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiChangeContentModel\execute(), ApiCheckToken\execute(), ApiClearHasMsg\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiCSPReport\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiFileRevert\execute(), ApiFormatFeedWrapper\execute(), ApiFormatJson\execute(), ApiFormatPhp\execute(), ApiFormatRaw\execute(), ApiFormatXml\execute(), ApiHelp\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogin\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOpenSearchFormatJson\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQuery\execute(), ApiQueryAllMessages\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryImageInfo\execute(), ApiQueryInfo\execute(), ApiQueryLanguageinfo\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryPageProps\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiQueryUserContribs\execute(), ApiQueryUserInfo\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiRsd\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiFormatRaw\getFilename(), ApiFormatRaw\getMimeType(), ApiFormatFeedWrapper\initPrinter(), ApiFormatRaw\initPrinter(), ApiQueryRevisionsBase\parseParameters(), ApiOpenSearch\populateResult(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryRandom\runQuery(), and ApiUpload\selectUploadModule().
|
protected |
Return the summary message.
This is a one-line description of the module, suitable for display in a list of modules.
Reimplemented in ApiQueryDisabled, and ApiDisabled.
Definition at line 1757 of file ApiBase.php.
ApiBase::getTitleFromTitleOrPageId | ( | $params | ) |
Get a Title 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.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
Definition at line 1083 of file ApiBase.php.
References wfEscapeWikiText().
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.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | false | $load | Whether load the object's state from the database:
|
Definition at line 1044 of file ApiBase.php.
References wfEscapeWikiText().
Referenced by ApiChangeContentModel\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiProtect\execute(), ApiSetPageLanguage\execute(), and ApiStashEdit\execute().
ApiBase::getWatchlistUser | ( | $params | ) |
Gets the user for whom to get the watchlist.
array | $params |
Definition at line 1190 of file ApiBase.php.
References getUser(), and wfEscapeWikiText().
|
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.
array | $params | All supplied parameters for the module |
Reimplemented in ApiUserrights, and ApiLogout.
Definition at line 475 of file ApiBase.php.
ApiBase::handleParamNormalization | ( | $paramName, | |
$value, | |||
$rawValue | |||
) |
Handle when a parameter was Unicode-normalized.
string | $paramName | Prefixed parameter name |
string | $value | Input that will be used. |
string | $rawValue | Input before normalization. |
Reimplemented in ApiPageSet.
Definition at line 1141 of file ApiBase.php.
ApiBase::isDeprecated | ( | ) |
Indicates whether this module is deprecated.
Reimplemented in ApiQueryDeletedrevs, and ApiLogin.
Definition at line 427 of file ApiBase.php.
ApiBase::isInternal | ( | ) |
Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party use and may be unstable.
Reimplemented in ApiStashEdit, and ApiCSPReport.
Definition at line 438 of file ApiBase.php.
ApiBase::isMain | ( | ) |
Returns true if this module is the main module ($this === $this->mMainModule), false otherwise.
Definition at line 531 of file ApiBase.php.
Referenced by __construct(), getModulePath(), and getParent().
ApiBase::isReadMode | ( | ) |
Indicates whether this module requires read rights.
Reimplemented in ApiRsd, ApiQueryTokens, ApiQueryAuthManagerInfo, ApiQuery, ApiParamInfo, ApiMain, ApiLogout, ApiLogin, ApiLinkAccount, ApiHelp, ApiDisabled, ApiCSPReport, ApiClientLogin, and ApiAMCreateAccount.
Definition at line 392 of file ApiBase.php.
ApiBase::isWriteMode | ( | ) |
Indicates whether this module requires write mode.
This should return true for modules that may require synchronous database writes. Modules that do not need such writes should also not rely on primary database access, since only read queries are needed and each primary DB is a single point of failure. Additionally, requests that only need replica DBs can be efficiently routed to any datacenter via the Promise-Non-Write-API-Action header.
Reimplemented in ApiWatch, ApiUserrights, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiStashEdit, ApiSetPageLanguage, ApiSetNotificationTimestamp, ApiRollback, ApiRevisionDelete, ApiResetPassword, ApiRemoveAuthenticationData, ApiPurge, ApiProtect, ApiPatrol, ApiOptions, ApiMove, ApiMergeHistory, ApiManageTags, ApiLogin, ApiLinkAccount, ApiImport, ApiImageRotate, ApiFileRevert, ApiEmailUser, ApiEditPage, ApiDelete, ApiClientLogin, ApiClearHasMsg, ApiChangeContentModel, ApiChangeAuthenticationData, ApiBlock, and ApiAMCreateAccount.
Definition at line 408 of file ApiBase.php.
Referenced by ApiMain\setRequestExpectations().
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
Reimplemented in ApiMain.
Definition at line 568 of file ApiBase.php.
References getMain().
Referenced by ApiLogin\execute(), ApiQueryDeletedrevs\execute(), and ApiQueryTokens\execute().
ApiBase::logFeatureUsage | ( | $feature | ) |
Write logging information for API features to a debug log, for usage analysis.
string | $feature | Feature being used. |
Definition at line 1711 of file ApiBase.php.
References $s, MediaWiki\Rest\Handler\getRequest(), getUser(), wfDebugLog(), and wfUrlencode().
|
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.
string | array | Message | $msg | |
IContextSource | $context | |
array | null | $params |
Definition at line 1229 of file ApiBase.php.
References wfMessage().
Referenced by ApiAMCreateAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), and ApiLinkAccount\getFinalDescription().
ApiBase::modifyHelp | ( | array & | $help, |
array | $options, | ||
array & | $tocData | ||
) |
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.
string[] | &$help | Array of help data |
array | $options | Options passed to ApiHelp::getHelp |
array | &$tocData | If a TOC is being generated, this array has keys as anchors in the page and values as for Linker::generateTOC(). |
Reimplemented in ApiMain.
Definition at line 2120 of file ApiBase.php.
ApiBase::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Reimplemented in ApiWatch, ApiValidatePassword, ApiUserrights, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiStashEdit, ApiSetPageLanguage, ApiSetNotificationTimestamp, ApiRollback, ApiRevisionDelete, ApiPurge, ApiProtect, ApiPatrol, ApiOptions, ApiMove, ApiMergeHistory, ApiManageTags, ApiLogout, ApiLogin, ApiImport, ApiImageRotate, ApiFileRevert, ApiEmailUser, ApiEditPage, ApiDelete, ApiCSPReport, ApiClearHasMsg, ApiChangeContentModel, and ApiBlock.
Definition at line 417 of file ApiBase.php.
References needsToken().
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.
Reimplemented in ApiWatch, ApiUserrights, ApiUpload, ApiUndelete, ApiUnblock, ApiTag, ApiStashEdit, ApiSetPageLanguage, ApiSetNotificationTimestamp, ApiRollback, ApiRevisionDelete, ApiResetPassword, ApiRemoveAuthenticationData, ApiProtect, ApiPatrol, ApiOptions, ApiMove, ApiMergeHistory, ApiManageTags, ApiLogout, ApiLinkAccount, ApiImport, ApiImageRotate, ApiFileRevert, ApiEmailUser, ApiEditPage, ApiDelete, ApiClientLogin, ApiChangeContentModel, ApiChangeAuthenticationData, ApiBlock, and ApiAMCreateAccount.
Definition at line 461 of file ApiBase.php.
Referenced by mustBePosted().
|
protected |
Parse the 'continue' parameter in the usual format and validate the types of each part, or die with the 'badcontinue' error if the format, types, or number of parts is wrong.
string | $continue | Value of 'continue' parameter obtained from extractRequestParams() |
string[] | $types | Types of the expected parts in order, 'string', 'int' or 'timestamp' |
ApiUsageException |
Definition at line 1649 of file ApiBase.php.
Referenced by ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryImageInfo\execute(), ApiQueryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryPageProps\execute(), ApiQueryUserContribs\execute(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), and ApiQueryRevisions\run().
ApiBase::requireAtLeastOneParameter | ( | $params, | |
$required | |||
) |
Die if none of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | ...$required Names of parameters of which at least one must be set |
Definition at line 971 of file ApiBase.php.
References Message\listParam().
Referenced by ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiEditPage\execute(), ApiLinkAccount\execute(), ApiQueryStashImageInfo\execute(), and ApiTag\execute().
ApiBase::requireMaxOneParameter | ( | $params, | |
$required | |||
) |
Die if more than one of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | ...$required Names of parameters of which at most one must be set |
Definition at line 946 of file ApiBase.php.
References Message\listParam().
Referenced by ApiExpandTemplates\execute(), ApiImport\execute(), ApiQueryAllUsers\execute(), ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryUsers\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), and ApiQueryRevisions\run().
ApiBase::requireOnlyOneParameter | ( | $params, | |
$required | |||
) |
Die if none or more than one of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | ...$required Names of parameters of which exactly one must be set |
Definition at line 911 of file ApiBase.php.
References Message\listParam().
Referenced by ApiBlock\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiQueryUserContribs\execute(), ApiResetPassword\execute(), ApiStashEdit\execute(), ApiUnblock\execute(), and ApiUpload\selectUploadModule().
ApiBase::requirePostedParameters | ( | $params, | |
$prefix = 'prefix' |
|||
) |
Die if any of the specified parameters were found in the query part of the URL rather than the post body.
string[] | $params | Parameters to check |
string | $prefix | Set to 'noprefix' to skip calling $this->encodeParamName() |
Definition at line 998 of file ApiBase.php.
References MediaWiki\Rest\Handler\getRequest().
Referenced by ApiLogin\execute(), and ApiValidatePassword\execute().
ApiBase::setContinuationManager | ( | ApiContinuationManager | $manager = null | ) |
ApiContinuationManager | null | $manager |
Reimplemented in ApiMain.
Definition at line 681 of file ApiBase.php.
References getMain().
Referenced by ApiImageRotate\execute(), ApiPurge\execute(), ApiQuery\execute(), ApiSetNotificationTimestamp\execute(), and ApiWatch\execute().
ApiBase::shouldCheckMaxlag | ( | ) |
Indicates if this module needs maxlag to be checked.
Reimplemented in ApiHelp.
Definition at line 383 of file ApiBase.php.
|
protected |
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition at line 1305 of file ApiBase.php.
References MediaWiki\Rest\Handler\getRequest(), and wfTransactionalTimeLimit().
Referenced by ApiDelete\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetPageLanguage\execute(), and ApiUndelete\execute().
|
final |
Validate the supplied token.
string | $token | Supplied token |
array | $params | All supplied parameters for the module |
MWException |
Definition at line 1154 of file ApiBase.php.
References MediaWiki\Rest\Handler\getRequest(), ApiQueryTokens\getToken(), ApiQueryTokens\getTokenTypeSalts(), and getUser().
string ApiBase::$mModulePrefix |
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Default is apihelp-{$path}-param-{$param}.
Definition at line 262 of file ApiBase.php.
Referenced by getModulePrefix().
const ApiBase::ALL_DEFAULT_STRING = '*' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Default is apihelp-{$path}-param-{$param}.
Definition at line 226 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
Definition at line 242 of file ApiBase.php.
Referenced by ApiPageSet\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), and ApiUserrights\getAllowedParams().
const ApiBase::LIMIT_BIG1 = 500 |
Fast query, standard limit.
Definition at line 229 of file ApiBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryAllUsers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit.
Definition at line 231 of file ApiBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryAllUsers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::LIMIT_SML1 = 50 |
Slow query, standard limit.
Definition at line 233 of file ApiBase.php.
Referenced by MediaWiki\Api\Validator\ApiParamValidator\__construct(), ApiQueryDeletedrevs\execute(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::LIMIT_SML2 = 500 |
Slow query, apihighlimits limit.
Definition at line 235 of file ApiBase.php.
Referenced by MediaWiki\Api\Validator\ApiParamValidator\__construct(), ApiQueryDeletedrevs\execute(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::PARAM_ALL = ParamValidator::PARAM_ALL |
Definition at line 121 of file ApiBase.php.
const ApiBase::PARAM_ALLOW_DUPLICATES = ParamValidator::PARAM_ALLOW_DUPLICATES |
Definition at line 101 of file ApiBase.php.
const ApiBase::PARAM_DEPRECATED = ParamValidator::PARAM_DEPRECATED |
Definition at line 105 of file ApiBase.php.
const ApiBase::PARAM_DEPRECATED_VALUES = EnumDef::PARAM_DEPRECATED_VALUES |
Definition at line 133 of file ApiBase.php.
const ApiBase::PARAM_DFLT = ParamValidator::PARAM_DEFAULT |
Definition at line 77 of file ApiBase.php.
const ApiBase::PARAM_EXTRA_NAMESPACES = NamespaceDef::PARAM_EXTRA_NAMESPACES |
Definition at line 125 of file ApiBase.php.
const ApiBase::PARAM_HELP_MSG = 'api-param-help-msg' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Default is apihelp-{$path}-param-{$param}.
Definition at line 166 of file ApiBase.php.
Referenced by ApiFeedWatchlist\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiPurge\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiWatch\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiFormatXml\getAllowedParams(), ApiLogin\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryInfo\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), and ApiAuthManagerHelper\getStandardParams().
const ApiBase::PARAM_HELP_MSG_APPEND = 'api-param-help-msg-append' |
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this parameter.
Definition at line 173 of file ApiBase.php.
Referenced by ApiUserrights\getAllowedParams(), ApiAMCreateAccount\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), and ApiRollback\getAllowedParams().
const ApiBase::PARAM_HELP_MSG_INFO = 'api-param-help-msg-info' |
(array) Specify additional information tags for the parameter.
Value is an array of arrays, with the first member being the 'tag' for the info and the remaining members being the values. In the help, this is formatted using apihelp-{$path}-paraminfo-{$tag}, which is passed $1 = count, $2 = comma-joined list of values, $3 = module prefix.
Definition at line 183 of file ApiBase.php.
Referenced by ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), and ApiQueryRevisions\getAllowedParams().
const ApiBase::PARAM_HELP_MSG_PER_VALUE = 'api-param-help-msg-per-value' |
((string|array|Message)[]) When PARAM_TYPE is an array, or 'string' with PARAM_ISMULTI, this is an array mapping parameter values to help message specifiers (to be passed to ApiBase::makeMessage()) about those values.
When PARAM_TYPE is an array, any value not having a mapping will use the apihelp-{$path}-paramvalue-{$param}-{$value} message. (This means you can use an empty array to use the default message key for all values.)
Definition at line 204 of file ApiBase.php.
Referenced by ApiFeedWatchlist\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiMain\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), and ApiQueryWatchlistRaw\getAllowedParams().
const ApiBase::PARAM_ISMULTI = ParamValidator::PARAM_ISMULTI |
Definition at line 81 of file ApiBase.php.
const ApiBase::PARAM_ISMULTI_LIMIT1 = ParamValidator::PARAM_ISMULTI_LIMIT1 |
Definition at line 137 of file ApiBase.php.
const ApiBase::PARAM_ISMULTI_LIMIT2 = ParamValidator::PARAM_ISMULTI_LIMIT2 |
Definition at line 141 of file ApiBase.php.
const ApiBase::PARAM_MAX = IntegerDef::PARAM_MAX |
Definition at line 89 of file ApiBase.php.
const ApiBase::PARAM_MAX2 = IntegerDef::PARAM_MAX2 |
Definition at line 93 of file ApiBase.php.
const ApiBase::PARAM_MAX_BYTES = StringDef::PARAM_MAX_BYTES |
Definition at line 145 of file ApiBase.php.
const ApiBase::PARAM_MAX_CHARS = StringDef::PARAM_MAX_CHARS |
Definition at line 149 of file ApiBase.php.
const ApiBase::PARAM_MIN = IntegerDef::PARAM_MIN |
Definition at line 97 of file ApiBase.php.
const ApiBase::PARAM_RANGE_ENFORCE = 'api-param-range-enforce' |
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition at line 156 of file ApiBase.php.
Referenced by ApiEditPage\getAllowedParams(), and MediaWiki\Api\Validator\ApiParamValidator\normalizeSettings().
const ApiBase::PARAM_REQUIRED = ParamValidator::PARAM_REQUIRED |
Definition at line 109 of file ApiBase.php.
const ApiBase::PARAM_SENSITIVE = ParamValidator::PARAM_SENSITIVE |
Definition at line 129 of file ApiBase.php.
const ApiBase::PARAM_SUBMODULE_MAP = SubmoduleDef::PARAM_SUBMODULE_MAP |
Definition at line 113 of file ApiBase.php.
const ApiBase::PARAM_SUBMODULE_PARAM_PREFIX = SubmoduleDef::PARAM_SUBMODULE_PARAM_PREFIX |
Definition at line 117 of file ApiBase.php.
const ApiBase::PARAM_TEMPLATE_VARS = 'param-template-vars' |
(array) Indicate that this is a templated parameter, and specify replacements.
Keys are the placeholders in the parameter name and values are the names of (unprefixed) parameters from which the replacement values are taken.
For example, a parameter "foo-{ns}-{title}" could be defined with PARAM_TEMPLATE_VARS => [ 'ns' => 'namespaces', 'title' => 'titles' ]. Then a query for namespaces=0|1&titles=X|Y would support parameters foo-0-X, foo-0-Y, foo-1-X, and foo-1-Y.
All placeholders must be present in the parameter's name. Each target parameter must have PARAM_ISMULTI true. If a target is itself a templated parameter, its PARAM_TEMPLATE_VARS must be a subset of the referring parameter's, mapping the same placeholders to the same targets. A parameter cannot target itself.
Definition at line 222 of file ApiBase.php.
Referenced by ApiComparePages\getAllowedParams().
const ApiBase::PARAM_TYPE = ParamValidator::PARAM_TYPE |
Definition at line 85 of file ApiBase.php.
const ApiBase::PARAM_VALUE_LINKS = 'api-param-value-links' |