|
MediaWiki master
|
This abstract class implements many basic API functions, and is the base of all API classes. More...
Inherits MediaWiki\Context\ContextSource.
Inherited by MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiAcquireTempUserName, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiCSPReport, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiCheckToken, MediaWiki\Api\ApiClearHasMsg, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiComparePages, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiDisabled, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiExpandTemplates, MediaWiki\Api\ApiFeedContributions, MediaWiki\Api\ApiFeedRecentChanges, MediaWiki\Api\ApiFeedWatchlist, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiFormatBase, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLanguageSearch, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiMain, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOpenSearch, MediaWiki\Api\ApiOptionsBase, MediaWiki\Api\ApiPageSet, MediaWiki\Api\ApiParamInfo, MediaWiki\Api\ApiParse, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiPurge, MediaWiki\Api\ApiQuery, MediaWiki\Api\ApiQueryBase, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiRsd, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, MediaWiki\Api\ApiValidatePassword, and MediaWiki\Api\ApiWatch.

Public Attributes | |
| const | PARAM_RANGE_ENFORCE = 'api-param-range-enforce' |
| (boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE | |
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 |
Protected Member Functions | |
Data Unified metrics methods | |
| recordUnifiedMetrics ( $detailLabels=[]) | |
| Record unified metrics for the API. | |
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. | |
| 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. | |
| const | PARAM_HELP_MSG_INFO = 'api-param-help-msg-info' |
| (array) Specify additional information tags for the parameter. | |
| const | PARAM_VALUE_LINKS = 'api-param-value-links' |
| Deprecated and unused. | |
| 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 messages. | |
| const | PARAM_TEMPLATE_VARS = 'param-template-vars' |
| (array) Indicate that this is a templated parameter, and specify replacements. | |
| const | ALL_DEFAULT_STRING = '*' |
| (string|array|Message) Specify an alternative i18n documentation message for this parameter. | |
| const | LIMIT_BIG1 = 500 |
| Fast query, standard limit. | |
| const | LIMIT_BIG2 = 5000 |
| Fast query, apihighlimits limit. | |
| const | LIMIT_SML1 = 50 |
| Slow query, standard limit. | |
| const | LIMIT_SML2 = 500 |
| Slow query, apihighlimits limit. | |
| const | GET_VALUES_FOR_HELP = 1 |
| getAllowedParams() flag: When this is set, the result could take longer to generate, but should be more thorough. | |
| __construct (ApiMain $mainModule, string $moduleName, string $modulePrefix='') | |
Methods to implement | |
| execute () | |
| Evaluates the parameters, performs the requested query, and sets up the result. | |
| getModuleManager () | |
| Get the module manager, or null if this module has no submodules. | |
| 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. | |
| getHelpUrls () | |
| Return links to more detailed help pages about the module. | |
| shouldCheckMaxlag () | |
| Indicates if this module needs maxlag to be checked. | |
| isReadMode () | |
| Indicates whether this module requires read rights. | |
| isWriteMode () | |
| Indicates whether this module requires write access to the wiki. | |
| mustBePosted () | |
| Indicates whether this module must be called with a POST request. | |
| isDeprecated () | |
| Indicates whether this module is deprecated. | |
| deprecationMsg () | |
| Returns a MessageSpecifier describing the deprecation if this module is deprecated, or returns null if this module is not deprecated or a description is not available. | |
| isInternal () | |
| Indicates whether this module is considered to be "internal". | |
| needsToken () | |
| Returns the token type this module requires in order to execute. | |
| getConditionalRequestData ( $condition) | |
| Returns data for HTTP conditional request mechanisms. | |
| getExamplesMessages () | |
| Returns usage examples for this module. | |
| 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. | |
| getWebUITokenSalt (array $params) | |
| Fetch the salt used in the Web UI corresponding to this module. | |
Data access methods | |
| getModuleName () | |
| Get the name of the module being executed by this instance. | |
| getModulePrefix () | |
| Get parameter prefix (usually two letters or an empty string). | |
| getMain () | |
| Get the main module. | |
| isMain () | |
| Returns true if this module is the main module ($this === $this->mMainModule), false otherwise. | |
| getParent () | |
| Get the parent of this module. | |
| lacksSameOriginSecurity () | |
| Returns true if the current request breaks the same-origin policy. | |
| getModulePath () | |
| Get the path to this module. | |
| getModuleFromPath ( $path) | |
| Get a module from its module path. | |
| getResult () | |
| Get the result object. | |
| getErrorFormatter () | |
| getContinuationManager () | |
| setContinuationManager (?ApiContinuationManager $manager=null) | |
| getDB () | |
| Gets a default replica DB connection object. | |
| getPermissionManager () | |
| Obtain a PermissionManager instance that subclasses may use in their authorization checks. | |
| getHookContainer () | |
| Get a HookContainer, for running extension hooks or for hook metadata. | |
| getHookRunner () | |
| Get an ApiHookRunner for running core API hooks. | |
Parameter handling | |
| dynamicParameterDocumentation () | |
| Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams(). | |
| encodeParamName ( $paramName) | |
| This method mangles parameter name based on the prefix supplied to the constructor. | |
| extractRequestParams ( $options=[]) | |
| Using getAllowedParams(), this function makes an array of the values provided by the user, with the key being the name of the variable, and value - validated value from user or default. | |
| requireOnlyOneParameter ( $params,... $required) | |
| Die if 0 or more than one of a certain set of parameters is set and not false. | |
| requireMaxOneParameter ( $params,... $required) | |
| Dies if more than one parameter from a certain set of parameters are set and not false. | |
| requireAtLeastOneParameter ( $params,... $required) | |
| Die if 0 of a certain set of parameters is set and not false. | |
| requireNoConflictingParameters ( $params, $trigger, $conflicts) | |
| Die with an "invalid param mix" error if the parameters contain the trigger parameter and any of the conflicting parameters. | |
| requirePostedParameters ( $params, $prefix='prefix') | |
| Die if any of the specified parameters were found in the query part of the URL rather than the HTTP post body contents. | |
| getTitleOrPageId ( $params, $load=false) | |
| Attempts to load a WikiPage object from a title or pageid parameter, if possible. | |
| getTitleFromTitleOrPageId ( $params) | |
| Get a Title object from a title or pageid param, if it is possible. | |
| handleParamNormalization ( $paramName, $value, $rawValue) | |
| Handle when a parameter was Unicode-normalized. | |
| validateToken ( $token, array $params) | |
| Validate the supplied token. | |
| getParameter ( $paramName, $parseLimit=true) | |
| Get a value for the given parameter. | |
| getParameterFromSettings ( $name, $settings, $parseLimit) | |
| Using the settings, determine the value for the given parameter. | |
Utility methods | |
| getWatchlistUser ( $params) | |
| Gets the user for whom to get the watchlist. | |
| useTransactionalTimeLimit () | |
| Call wfTransactionalTimeLimit() if this request was POSTed. | |
| filterIDs ( $fields, array $ids) | |
| Filter out-of-range values from a list of positive integer IDs. | |
| static | clearCacheForTest () |
| Reset static caches of database state. | |
Warning and error reporting | |
| addWarning ( $msg, $code=null, $data=null) | |
| Add a warning for this module. | |
| addDeprecation ( $msg, $feature, $data=[]) | |
| Add a deprecation warning for this module. | |
| addError ( $msg, $code=null, $data=null) | |
| Add an error for this module without aborting. | |
| addMessagesFromStatus (StatusValue $status, $types=[ 'warning', 'error'], array $filter=[]) | |
| Add warnings and/or errors from a Status. | |
| dieWithError ( $msg, $code=null, $data=null, $httpCode=0) | |
| Abort execution with an error. | |
| dieWithException (Throwable $exception, array $options=[]) | |
| Abort execution with an error derived from a throwable. | |
| 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. | |
| dieStatus (StatusValue $status) | |
| Throw an ApiUsageException based on the Status object. | |
| dieReadOnly () | |
| Helper function for readonly errors. | |
| checkUserRightsAny ( $rights) | |
| Helper function for permission-denied errors. | |
| checkTitleUserPermissions (PageIdentity $pageIdentity, $actions, array $options=[]) | |
| Helper function for permission-denied errors. | |
| dieWithErrorOrDebug ( $msg, $code=null, $data=null, $httpCode=null) | |
| Will only set a warning instead of failing if the global $wgDebugAPI is set to true. | |
| logFeatureUsage ( $feature) | |
| Write logging information for API features to a debug log, for usage analysis. | |
| 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 the number of parts is wrong. | |
| dieContinueUsageIf ( $condition) | |
| Die with the 'badcontinue' error. | |
| static | dieDebug ( $method, $message) |
| Internal code errors should be reported with this method. | |
Help message generation | |
| getFinalSummary () | |
| Get the final module summary. | |
| getFinalDescription () | |
| Get the final module description, after hooks have had a chance to tweak it as needed. | |
| getFinalParams ( $flags=0) | |
| Get the final list of parameters, after hooks have had a chance to tweak it as needed. | |
| getFinalParamDescription () | |
| Get final parameter descriptions, after hooks have had a chance to tweak it as needed. | |
| modifyHelp (array &$help, array $options, array &$tocData) | |
| Called from ApiHelp before the pieces are joined together and returned. | |
| getSummaryMessage () | |
| Return the summary message. | |
| getExtendedDescription () | |
| Return the extended help text message. | |
| getHelpFlags () | |
| Generates the list of flags for the help screen and for action=paraminfo. | |
| getModuleSourceInfo () | |
| Returns information about the source of this module, if known. | |
Additional Inherited Members | |
| Public Member Functions inherited from MediaWiki\Context\ContextSource | |
| canUseWikiPage () | |
| Check whether a WikiPage object can be get with getWikiPage(). | |
| exportSession () | |
| Export the resolved user IP, HTTP headers, user ID, and session ID. | |
| getActionName () | |
| Get the action name for the current web request. | |
| getAuthority () | |
| getConfig () | |
| getContext () | |
| Get the base IContextSource object. | |
| getCsrfTokenSet () | |
| Get a repository to obtain and match CSRF tokens. | |
| getLanguage () | |
| getLanguageCode () | |
| getOutput () | |
| getRequest () | |
| getSkin () | |
| getTiming () | |
| getTitle () | |
| getUser () | |
| getWikiPage () | |
| Get the WikiPage object. | |
| msg ( $key,... $params) | |
| Get a Message object with context set Parameters are the same as wfMessage(). | |
| 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.
| MediaWiki\Api\ApiBase::__construct | ( | ApiMain | $mainModule, |
| string | $moduleName, | ||
| string | $modulePrefix = '' ) |
| ApiMain | $mainModule | |
| string | $moduleName | Name of this module |
| string | $modulePrefix | Prefix to use for parameter names |
Definition at line 285 of file ApiBase.php.
References MediaWiki\Context\ContextSource\getContext(), isMain(), and MediaWiki\Context\ContextSource\setContext().
| MediaWiki\Api\ApiBase::addDeprecation | ( | $msg, | |
| $feature, | |||
| $data = [] ) |
Add a deprecation warning for this module.
A combination of $this->addWarning() and $this->logFeatureUsage()
| string | array | MessageSpecifier | $msg | See ApiErrorFormatter::addWarning() Consider passing $this->deprecationMsg() here. |
| string | null | $feature | See ApiBase::logFeatureUsage() |
| array | null | $data | See ApiErrorFormatter::addWarning() |
Definition at line 1414 of file ApiBase.php.
References addWarning(), getHookRunner(), getMain(), logFeatureUsage(), and MediaWiki\Context\ContextSource\msg().
Referenced by MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), and MediaWiki\Api\ApiMain\setupExternalResponse().
| MediaWiki\Api\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 | MessageSpecifier | $msg | See ApiErrorFormatter::addError() |
| string | null | $code | See ApiErrorFormatter::addError() |
| array | null | $data | See ApiErrorFormatter::addError() |
Definition at line 1447 of file ApiBase.php.
References getErrorFormatter(), and getModulePath().
| MediaWiki\Api\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 1460 of file ApiBase.php.
References getErrorFormatter(), and getModulePath().
Referenced by MediaWiki\Api\ApiUndelete\execute().
| MediaWiki\Api\ApiBase::addWarning | ( | $msg, | |
| $code = null, | |||
| $data = null ) |
Add a warning for this module.
Users should monitor this section to notice any changes in the 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 | MessageSpecifier | $msg | See ApiErrorFormatter::addWarning() |
| string | null | $code | See ApiErrorFormatter::addWarning() |
| array | null | $data | See ApiErrorFormatter::addWarning() |
Definition at line 1399 of file ApiBase.php.
References getErrorFormatter(), and getModulePath().
Referenced by addDeprecation(), MediaWiki\Api\ApiQueryBase\addWhereRange(), dieWithErrorOrDebug(), MediaWiki\Api\ApiCheckToken\execute(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiLogout\execute(), MediaWiki\Api\ApiOptionsBase\execute(), MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQueryDisabled\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiQueryTokens\execute(), MediaWiki\Api\ApiUpload\execute(), extractRequestParams(), MediaWiki\Api\ApiMain\getVal(), MediaWiki\Api\ApiMain\handleException(), handleParamNormalization(), MediaWiki\Api\ApiQueryImageInfo\mergeThumbParams(), MediaWiki\Api\ApiQueryRevisionsBase\parseParameters(), MediaWiki\Api\ApiMain\printResult(), MediaWiki\Api\ApiMain\reportUnusedParams(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), and MediaWiki\Api\ApiOptions\shouldIgnoreKey().
| MediaWiki\Api\ApiBase::checkTitleUserPermissions | ( | PageIdentity | $pageIdentity, |
| $actions, | |||
| array | $options = [] ) |
Helper function for permission-denied errors.
| PageIdentity | $pageIdentity | |
| string | string[] | $actions | |
| array | $options | Additional options
|
| ApiUsageException | if the user doesn't have all the necessary rights. |
Definition at line 1614 of file ApiBase.php.
References dieStatus(), MediaWiki\Context\ContextSource\getAuthority(), MediaWiki\Context\ContextSource\getUser(), and isWriteMode().
Referenced by MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiProtect\execute(), and MediaWiki\Api\ApiSetPageLanguage\execute().
| MediaWiki\Api\ApiBase::checkUserRightsAny | ( | $rights | ) |
Helper function for permission-denied errors.
| string | string[] | $rights |
| ApiUsageException | if the user doesn't have any of the rights. The error message is based on $rights[0]. |
Definition at line 1591 of file ApiBase.php.
References dieWithError(), MediaWiki\Context\ContextSource\getAuthority(), and MediaWiki\Context\ContextSource\msg().
Referenced by MediaWiki\Api\ApiAcquireTempUserName\execute(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiLogout\execute(), MediaWiki\Api\ApiOptionsBase\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiWatch\execute(), and getWatchlistUser().
|
static |
Reset static caches of database state.
Definition at line 1340 of file ApiBase.php.
References if.
| MediaWiki\Api\ApiBase::deprecationMsg | ( | ) |
Returns a MessageSpecifier describing the deprecation if this module is deprecated, or returns null if this module is not deprecated or a description is not available.
Reimplemented in MediaWiki\Api\ApiLogin, and MediaWiki\Api\ApiQueryDeletedrevs.
Definition at line 474 of file ApiBase.php.
References return.
Referenced by isDeprecated().
| MediaWiki\Api\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 1510 of file ApiBase.php.
References dieWithError(), MediaWiki\Context\ContextSource\getContext(), MediaWiki\Context\ContextSource\getRequest(), and MediaWiki\Context\ContextSource\getUser().
Referenced by MediaWiki\Api\ApiUpload\checkPermissions(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUndelete\execute(), and MediaWiki\Api\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 1706 of file ApiBase.php.
References dieWithError().
Referenced by MediaWiki\Api\ApiQueryInfo\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), parseContinueParamOrDie(), and MediaWiki\Api\ApiQueryRandom\run().
|
staticprotected |
Internal code errors should be reported with this method.
| string | $method | Method or function name |
| string | $message | Error message |
Definition at line 1719 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQueryAllLinks\__construct(), MediaWiki\Api\ApiQueryLinks\__construct(), MediaWiki\Api\ApiQueryBase\addJoinConds(), MediaWiki\Api\ApiQueryBase\addTables(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiFormatFeedWrapper\execute(), MediaWiki\Api\ApiFormatJson\execute(), MediaWiki\Api\ApiFormatRaw\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQuerySiteinfo\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiOpenSearch\getCustomPrinter(), MediaWiki\Api\ApiFormatRaw\getMimeType(), MediaWiki\Api\ApiFormatFeedWrapper\initPrinter(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), and MediaWiki\Api\ApiQueryRevisions\run().
| MediaWiki\Api\ApiBase::dieReadOnly | ( | ) |
Helper function for readonly errors.
| ApiUsageException | always |
Definition at line 1575 of file ApiBase.php.
References dieWithError().
Referenced by MediaWiki\Api\ApiMain\checkReadOnly(), and MediaWiki\Api\ApiEditPage\execute().
| MediaWiki\Api\ApiBase::dieStatus | ( | StatusValue | $status | ) |
Throw an ApiUsageException based on the Status object.
| StatusValue | $status |
| ApiUsageException | always |
Definition at line 1533 of file ApiBase.php.
References if.
Referenced by MediaWiki\Api\ApiUpload\checkPermissions(), checkTitleUserPermissions(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEmailUser\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiResetPassword\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiUpload\performUpload(), and MediaWiki\Api\ApiQueryRevisions\run().
| MediaWiki\Api\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 | MessageSpecifier | $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 1482 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQuerySiteinfo\appendDbReplLagInfo(), MediaWiki\Api\ApiQuerySiteinfo\appendSBOM(), MediaWiki\Api\ApiMain\checkAsserts(), MediaWiki\Api\ApiMain\checkExecutePermissions(), MediaWiki\Api\ApiMain\checkMaxLag(), MediaWiki\Api\ApiQueryImageInfo\checkParameterNormalise(), MediaWiki\Api\ApiUpload\checkPermissions(), checkUserRightsAny(), MediaWiki\Api\ApiMain\createPrinterByName(), dieBlocked(), dieContinueUsageIf(), dieReadOnly(), dieWithErrorOrDebug(), dieWithException(), MediaWiki\Api\ApiAcquireTempUserName\execute(), MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiDisabled\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEmailUser\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiFeedContributions\execute(), MediaWiki\Api\ApiFeedRecentChanges\execute(), MediaWiki\Api\ApiFeedWatchlist\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiOpenSearchFormatJson\execute(), MediaWiki\Api\ApiOptionsBase\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiQueryAllMessages\execute(), MediaWiki\Api\ApiQueryAuthManagerInfo\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryExternalLinks\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiQueryInfo\execute(), MediaWiki\Api\ApiQueryIWLinks\execute(), MediaWiki\Api\ApiQueryLangLinks\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryMyStashedFiles\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiResetPassword\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiWatch\execute(), MediaWiki\Api\ApiQueryAllImages\executeGenerator(), MediaWiki\Api\ApiQueryAllPages\executeGenerator(), getModuleFromPath(), getTitleFromTitleOrPageId(), getTitleOrPageId(), getWatchlistUser(), MediaWiki\Api\ApiQueryImageInfo\mergeThumbParams(), MediaWiki\Api\ApiQueryRevisionsBase\parseParameters(), MediaWiki\Api\ApiQueryBase\parsePrefixedTitlePart(), MediaWiki\Api\ApiUpload\performUpload(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireNoConflictingParameters(), requireOnlyOneParameter(), requirePostedParameters(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), MediaWiki\Api\ApiQueryIWBacklinks\run(), MediaWiki\Api\ApiQueryLangBacklinks\run(), MediaWiki\Api\ApiQueryQueryPage\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiQueryRevisions\run(), MediaWiki\Api\ApiUpload\selectUploadModule(), MediaWiki\Api\ApiMain\setupExternalResponse(), MediaWiki\Api\ApiQueryBase\titlePartToKey(), MediaWiki\Api\ApiFileRevert\validateParameters(), and MediaWiki\Api\ApiUpload\verifyUpload().
| MediaWiki\Api\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, it behaves exactly as self::dieWithError().
| string | array | Message | $msg | Message definition, see Message::newFromSpecifier() |
| string | null | $code | |
| array | null | $data | |
| int | null | $httpCode |
| ApiUsageException |
Definition at line 1649 of file ApiBase.php.
References addWarning(), MediaWiki\MainConfigNames\DebugAPI, dieWithError(), and MediaWiki\Context\ContextSource\getConfig().
Referenced by MediaWiki\Api\ApiMain\setupExternalResponse().
| MediaWiki\Api\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 1495 of file ApiBase.php.
References dieWithError(), and getErrorFormatter().
Referenced by MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), and MediaWiki\Api\ApiStashEdit\execute().
| MediaWiki\Api\ApiBase::dynamicParameterDocumentation | ( | ) |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams().
Reimplemented in MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiClientLogin, and MediaWiki\Api\ApiLinkAccount.
Definition at line 796 of file ApiBase.php.
| MediaWiki\Api\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 MediaWiki\Api\ApiQueryGeneratorBase.
Definition at line 808 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiContinuationManager\addContinueParam(), MediaWiki\Api\ApiContinuationManager\addGeneratorContinueParam(), MediaWiki\Api\ApiContinuationManager\addGeneratorNonContinueParam(), MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiQueryAllMessages\execute(), MediaWiki\Api\ApiQueryIWLinks\execute(), MediaWiki\Api\ApiQueryLangLinks\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiWatch\execute(), extractRequestParams(), getParameterFromSettings(), MediaWiki\Api\Validator\ApiParamValidator\getValue(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireNoConflictingParameters(), requireOnlyOneParameter(), requirePostedParameters(), and MediaWiki\Api\Validator\ApiParamValidator\validateValue().
|
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 MediaWiki\Api\ApiAcquireTempUserName, MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiCheckToken, MediaWiki\Api\ApiClearHasMsg, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiComparePages, MediaWiki\Api\ApiCSPReport, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiDisabled, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiExpandTemplates, MediaWiki\Api\ApiFeedContributions, MediaWiki\Api\ApiFeedRecentChanges, MediaWiki\Api\ApiFeedWatchlist, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiFormatFeedWrapper, MediaWiki\Api\ApiFormatJson, MediaWiki\Api\ApiFormatNone, MediaWiki\Api\ApiFormatRaw, MediaWiki\Api\ApiFormatXml, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLanguageSearch, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiMain, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOpenSearch, MediaWiki\Api\ApiOpenSearchFormatJson, MediaWiki\Api\ApiOptionsBase, MediaWiki\Api\ApiPageSet, MediaWiki\Api\ApiParamInfo, MediaWiki\Api\ApiParse, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiPurge, MediaWiki\Api\ApiQuery, MediaWiki\Api\ApiQueryAllCategories, MediaWiki\Api\ApiQueryAllImages, MediaWiki\Api\ApiQueryAllLinks, MediaWiki\Api\ApiQueryAllMessages, MediaWiki\Api\ApiQueryAllPages, MediaWiki\Api\ApiQueryAllUsers, MediaWiki\Api\ApiQueryAuthManagerInfo, MediaWiki\Api\ApiQueryBacklinks, MediaWiki\Api\ApiQueryBacklinksprop, MediaWiki\Api\ApiQueryBlocks, MediaWiki\Api\ApiQueryCategories, MediaWiki\Api\ApiQueryCategoryInfo, MediaWiki\Api\ApiQueryCategoryMembers, MediaWiki\Api\ApiQueryCodexIcons, MediaWiki\Api\ApiQueryContributors, MediaWiki\Api\ApiQueryDeletedrevs, MediaWiki\Api\ApiQueryDisabled, MediaWiki\Api\ApiQueryDuplicateFiles, MediaWiki\Api\ApiQueryExternalLinks, MediaWiki\Api\ApiQueryExtLinksUsage, MediaWiki\Api\ApiQueryFilearchive, MediaWiki\Api\ApiQueryFileRepoInfo, MediaWiki\Api\ApiQueryImageInfo, MediaWiki\Api\ApiQueryImages, MediaWiki\Api\ApiQueryInfo, MediaWiki\Api\ApiQueryIWBacklinks, MediaWiki\Api\ApiQueryIWLinks, MediaWiki\Api\ApiQueryLangBacklinks, MediaWiki\Api\ApiQueryLangLinks, MediaWiki\Api\ApiQueryLanguageinfo, MediaWiki\Api\ApiQueryLinks, MediaWiki\Api\ApiQueryLogEvents, MediaWiki\Api\ApiQueryMyStashedFiles, MediaWiki\Api\ApiQueryPagePropNames, MediaWiki\Api\ApiQueryPageProps, MediaWiki\Api\ApiQueryPagesWithProp, MediaWiki\Api\ApiQueryPrefixSearch, MediaWiki\Api\ApiQueryProtectedTitles, MediaWiki\Api\ApiQueryQueryPage, MediaWiki\Api\ApiQueryRandom, MediaWiki\Api\ApiQueryRecentChanges, MediaWiki\Api\ApiQueryRevisionsBase, MediaWiki\Api\ApiQuerySearch, MediaWiki\Api\ApiQuerySiteinfo, MediaWiki\Api\ApiQueryStashImageInfo, MediaWiki\Api\ApiQueryTags, MediaWiki\Api\ApiQueryTokens, MediaWiki\Api\ApiQueryTrackingCategories, MediaWiki\Api\ApiQueryUserContribs, MediaWiki\Api\ApiQueryUserInfo, MediaWiki\Api\ApiQueryUsers, MediaWiki\Api\ApiQueryWatchlist, MediaWiki\Api\ApiQueryWatchlistRaw, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiRsd, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, MediaWiki\Api\ApiValidatePassword, and MediaWiki\Api\ApiWatch.
| MediaWiki\Api\ApiBase::extractRequestParams | ( | $options = [] | ) |
Using getAllowedParams(), this function makes an array of the values provided by the user, with the 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 830 of file ApiBase.php.
References addWarning(), encodeParamName(), getFinalParams(), getParameterFromSettings(), and wfEscapeWikiText().
Referenced by MediaWiki\Api\ApiContinuationManager\__construct(), MediaWiki\Api\ApiPageSet\__construct(), MediaWiki\Api\ApiQuerySiteinfo\appendInterwikiMap(), MediaWiki\Api\ApiQuerySiteinfo\appendLanguages(), MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiCheckToken\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEmailUser\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiFeedContributions\execute(), MediaWiki\Api\ApiFeedRecentChanges\execute(), MediaWiki\Api\ApiFeedWatchlist\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiFormatJson\execute(), MediaWiki\Api\ApiFormatXml\execute(), MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiLanguageSearch\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiOpenSearch\execute(), MediaWiki\Api\ApiOptionsBase\execute(), MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiQueryAllMessages\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryAuthManagerInfo\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryCategoryInfo\execute(), MediaWiki\Api\ApiQueryCodexIcons\execute(), MediaWiki\Api\ApiQueryContributors\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryExternalLinks\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryFileRepoInfo\execute(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiQueryInfo\execute(), MediaWiki\Api\ApiQueryIWLinks\execute(), MediaWiki\Api\ApiQueryLangLinks\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryMyStashedFiles\execute(), MediaWiki\Api\ApiQueryPagePropNames\execute(), MediaWiki\Api\ApiQueryPageProps\execute(), MediaWiki\Api\ApiQuerySiteinfo\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), MediaWiki\Api\ApiQueryTags\execute(), MediaWiki\Api\ApiQueryTokens\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiQueryUserInfo\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiResetPassword\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiWatch\execute(), MediaWiki\Api\ApiHelp\getCustomPrinter(), MediaWiki\Api\ApiFormatJson\getMimeType(), getParameter(), MediaWiki\Api\ApiQuery\isReadMode(), MediaWiki\Api\ApiQuery\isWriteMode(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), MediaWiki\Api\ApiQueryIWBacklinks\run(), MediaWiki\Api\ApiQueryLangBacklinks\run(), MediaWiki\Api\ApiQueryQueryPage\run(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiQueryRevisions\run(), MediaWiki\Api\ApiQueryRandom\runQuery(), and MediaWiki\Api\ApiMain\setupExecuteAction().
|
protected |
Filter out-of-range values from a list of positive integer IDs.
| string[][] | $fields | Array of table and field pairs to check |
| (string|int)[] | $ids IDs to filter. Strings in the array are expected to be stringified integers. |
Definition at line 1356 of file ApiBase.php.
References getDB().
Referenced by MediaWiki\Api\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 MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiCheckToken, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiComparePages, MediaWiki\Api\ApiCSPReport, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiExpandTemplates, MediaWiki\Api\ApiFeedContributions, MediaWiki\Api\ApiFeedRecentChanges, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiFormatBase, MediaWiki\Api\ApiFormatJson, MediaWiki\Api\ApiFormatXml, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLanguageSearch, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiMain, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOpenSearch, MediaWiki\Api\ApiOptions, MediaWiki\Api\ApiOptionsBase, MediaWiki\Api\ApiParamInfo, MediaWiki\Api\ApiParse, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiQueryAllCategories, MediaWiki\Api\ApiQueryAllDeletedRevisions, MediaWiki\Api\ApiQueryAllImages, MediaWiki\Api\ApiQueryAllLinks, MediaWiki\Api\ApiQueryAllMessages, MediaWiki\Api\ApiQueryAllPages, MediaWiki\Api\ApiQueryAllRevisions, MediaWiki\Api\ApiQueryAuthManagerInfo, MediaWiki\Api\ApiQueryBacklinks, MediaWiki\Api\ApiQueryBacklinksprop, MediaWiki\Api\ApiQueryBlocks, MediaWiki\Api\ApiQueryCategories, MediaWiki\Api\ApiQueryCategoryInfo, MediaWiki\Api\ApiQueryCategoryMembers, MediaWiki\Api\ApiQueryCodexIcons, MediaWiki\Api\ApiQueryDeletedRevisions, MediaWiki\Api\ApiQueryDeletedrevs, MediaWiki\Api\ApiQueryDuplicateFiles, MediaWiki\Api\ApiQueryExternalLinks, MediaWiki\Api\ApiQueryExtLinksUsage, MediaWiki\Api\ApiQueryFilearchive, MediaWiki\Api\ApiQueryFileRepoInfo, MediaWiki\Api\ApiQueryImageInfo, MediaWiki\Api\ApiQueryImages, MediaWiki\Api\ApiQueryInfo, MediaWiki\Api\ApiQueryIWBacklinks, MediaWiki\Api\ApiQueryIWLinks, MediaWiki\Api\ApiQueryLangBacklinks, MediaWiki\Api\ApiQueryLangLinks, MediaWiki\Api\ApiQueryLanguageinfo, MediaWiki\Api\ApiQueryLinks, MediaWiki\Api\ApiQueryMyStashedFiles, MediaWiki\Api\ApiQueryPagePropNames, MediaWiki\Api\ApiQueryPageProps, MediaWiki\Api\ApiQueryPagesWithProp, MediaWiki\Api\ApiQueryPrefixSearch, MediaWiki\Api\ApiQueryProtectedTitles, MediaWiki\Api\ApiQueryQueryPage, MediaWiki\Api\ApiQueryRandom, MediaWiki\Api\ApiQueryRecentChanges, MediaWiki\Api\ApiQueryRevisions, MediaWiki\Api\ApiQueryRevisionsBase, MediaWiki\Api\ApiQuerySearch, MediaWiki\Api\ApiQuerySiteinfo, MediaWiki\Api\ApiQueryStashImageInfo, MediaWiki\Api\ApiQueryTags, MediaWiki\Api\ApiQueryTokens, MediaWiki\Api\ApiQueryTrackingCategories, MediaWiki\Api\ApiQueryUserContribs, MediaWiki\Api\ApiQueryUserInfo, MediaWiki\Api\ApiQueryUsers, MediaWiki\Api\ApiQueryWatchlist, MediaWiki\Api\ApiQueryWatchlistRaw, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, and MediaWiki\Api\ApiValidatePassword.
Definition at line 384 of file ApiBase.php.
Referenced by getFinalParams().
| MediaWiki\Api\ApiBase::getConditionalRequestData | ( | $condition | ) |
Returns data for HTTP conditional request mechanisms.
| string | $condition | Condition being queried:
|
Definition at line 541 of file ApiBase.php.
| MediaWiki\Api\ApiBase::getContinuationManager | ( | ) |
Reimplemented in MediaWiki\Api\ApiMain.
Definition at line 732 of file ApiBase.php.
References getMain().
Referenced by MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiQueryBase\setContinueEnumParameter(), and MediaWiki\Api\ApiQueryGeneratorBase\setContinueEnumParameter().
| MediaWiki\Api\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 MediaWiki\Api\ApiFeedContributions, MediaWiki\Api\ApiFeedRecentChanges, MediaWiki\Api\ApiFeedWatchlist, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiOpenSearch, MediaWiki\Api\ApiQuery, and MediaWiki\Api\ApiRsd.
Definition at line 340 of file ApiBase.php.
|
protected |
Gets a default replica DB connection object.
Reimplemented in MediaWiki\Api\ApiPageSet, MediaWiki\Api\ApiQueryAllImages, and MediaWiki\Api\ApiQueryBase.
Definition at line 719 of file ApiBase.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by filterIDs(), and parseContinueParamOrDie().
| MediaWiki\Api\ApiBase::getErrorFormatter | ( | ) |
Reimplemented in MediaWiki\Api\ApiMain.
Definition at line 706 of file ApiBase.php.
References getMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), dieWithException(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiUpload\handleStashException(), MediaWiki\Api\ApiMove\moveSubpages(), and MediaWiki\Api\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 MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiCheckToken, MediaWiki\Api\ApiClearHasMsg, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiComparePages, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiExpandTemplates, MediaWiki\Api\ApiFeedContributions, MediaWiki\Api\ApiFeedRecentChanges, MediaWiki\Api\ApiFeedWatchlist, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiFormatBase, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLanguageSearch, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiMain, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOpenSearch, MediaWiki\Api\ApiOptions, MediaWiki\Api\ApiParamInfo, MediaWiki\Api\ApiParse, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiPurge, MediaWiki\Api\ApiQuery, MediaWiki\Api\ApiQueryAllCategories, MediaWiki\Api\ApiQueryAllDeletedRevisions, MediaWiki\Api\ApiQueryAllImages, MediaWiki\Api\ApiQueryAllLinks, MediaWiki\Api\ApiQueryAllMessages, MediaWiki\Api\ApiQueryAllPages, MediaWiki\Api\ApiQueryAllRevisions, MediaWiki\Api\ApiQueryAllUsers, MediaWiki\Api\ApiQueryAuthManagerInfo, MediaWiki\Api\ApiQueryBacklinks, MediaWiki\Api\ApiQueryBacklinksprop, MediaWiki\Api\ApiQueryBlocks, MediaWiki\Api\ApiQueryCategories, MediaWiki\Api\ApiQueryCategoryInfo, MediaWiki\Api\ApiQueryCategoryMembers, MediaWiki\Api\ApiQueryCodexIcons, MediaWiki\Api\ApiQueryContributors, MediaWiki\Api\ApiQueryDeletedRevisions, MediaWiki\Api\ApiQueryDeletedrevs, MediaWiki\Api\ApiQueryDuplicateFiles, MediaWiki\Api\ApiQueryExternalLinks, MediaWiki\Api\ApiQueryExtLinksUsage, MediaWiki\Api\ApiQueryFilearchive, MediaWiki\Api\ApiQueryFileRepoInfo, MediaWiki\Api\ApiQueryImageInfo, MediaWiki\Api\ApiQueryImages, MediaWiki\Api\ApiQueryInfo, MediaWiki\Api\ApiQueryIWBacklinks, MediaWiki\Api\ApiQueryIWLinks, MediaWiki\Api\ApiQueryLangBacklinks, MediaWiki\Api\ApiQueryLangLinks, MediaWiki\Api\ApiQueryLanguageinfo, MediaWiki\Api\ApiQueryLinks, MediaWiki\Api\ApiQueryLogEvents, MediaWiki\Api\ApiQueryMyStashedFiles, MediaWiki\Api\ApiQueryPagePropNames, MediaWiki\Api\ApiQueryPageProps, MediaWiki\Api\ApiQueryPagesWithProp, MediaWiki\Api\ApiQueryPrefixSearch, MediaWiki\Api\ApiQueryProtectedTitles, MediaWiki\Api\ApiQueryQueryPage, MediaWiki\Api\ApiQueryRandom, MediaWiki\Api\ApiQueryRecentChanges, MediaWiki\Api\ApiQueryRevisions, MediaWiki\Api\ApiQuerySearch, MediaWiki\Api\ApiQuerySiteinfo, MediaWiki\Api\ApiQueryStashImageInfo, MediaWiki\Api\ApiQueryTags, MediaWiki\Api\ApiQueryTokens, MediaWiki\Api\ApiQueryTrackingCategories, MediaWiki\Api\ApiQueryUserContribs, MediaWiki\Api\ApiQueryUserInfo, MediaWiki\Api\ApiQueryUsers, MediaWiki\Api\ApiQueryWatchlist, MediaWiki\Api\ApiQueryWatchlistRaw, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiRsd, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, MediaWiki\Api\ApiValidatePassword, and MediaWiki\Api\ApiWatch.
Definition at line 356 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 MediaWiki\Api\ApiDisabled, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiQueryDisabled, MediaWiki\Api\ApiResetPassword, and MediaWiki\Api\ApiSetPageLanguage.
Definition at line 1800 of file ApiBase.php.
Referenced by getFinalDescription().
| MediaWiki\Api\ApiBase::getFinalDescription | ( | ) |
Get the final module description, after hooks have had a chance to tweak it as needed.
Reimplemented in MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiClientLogin, and MediaWiki\Api\ApiLinkAccount.
Definition at line 1830 of file ApiBase.php.
References getExtendedDescription(), getHookRunner(), getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), MediaWiki\Context\ContextSource\msg(), MediaWiki\Message\Message\newFallbackSequence(), and MediaWiki\Message\Message\newFromSpecifier().
| MediaWiki\Api\ApiBase::getFinalParamDescription | ( | ) |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed.
Definition at line 1897 of file ApiBase.php.
References $path, MediaWiki\Api\ApiMessage\create(), MediaWiki\Context\ContextSource\getContext(), getFinalParams(), getHookRunner(), getModuleFromPath(), getModuleManager(), getModuleName(), getModulePath(), getModulePrefix(), isMain(), MediaWiki\Context\ContextSource\msg(), MediaWiki\Message\Message\newFallbackSequence(), and MediaWiki\Message\Message\newFromSpecifier().
| MediaWiki\Api\ApiBase::getFinalParams | ( | $flags = 0 | ) |
Get the 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 1866 of file ApiBase.php.
References getAllowedParams(), getHookRunner(), and needsToken().
Referenced by extractRequestParams(), and getFinalParamDescription().
| MediaWiki\Api\ApiBase::getFinalSummary | ( | ) |
Get the final module summary.
Definition at line 1814 of file ApiBase.php.
References getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), MediaWiki\Context\ContextSource\msg(), and MediaWiki\Message\Message\newFromSpecifier().
|
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 MediaWiki\Api\ApiQueryGeneratorBase.
Definition at line 2042 of file ApiBase.php.
References isDeprecated(), isInternal(), isReadMode(), isWriteMode(), and mustBePosted().
| MediaWiki\Api\ApiBase::getHelpUrls | ( | ) |
Return links to more detailed help pages about the module.
Reimplemented in MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiCheckToken, MediaWiki\Api\ApiClearHasMsg, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiComparePages, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiExpandTemplates, MediaWiki\Api\ApiFeedContributions, MediaWiki\Api\ApiFeedRecentChanges, MediaWiki\Api\ApiFeedWatchlist, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiFormatBase, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLanguageSearch, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOpenSearch, MediaWiki\Api\ApiOptions, MediaWiki\Api\ApiParamInfo, MediaWiki\Api\ApiParse, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiPurge, MediaWiki\Api\ApiQuery, MediaWiki\Api\ApiQueryAllCategories, MediaWiki\Api\ApiQueryAllDeletedRevisions, MediaWiki\Api\ApiQueryAllImages, MediaWiki\Api\ApiQueryAllLinks, MediaWiki\Api\ApiQueryAllMessages, MediaWiki\Api\ApiQueryAllPages, MediaWiki\Api\ApiQueryAllRevisions, MediaWiki\Api\ApiQueryAllUsers, MediaWiki\Api\ApiQueryAuthManagerInfo, MediaWiki\Api\ApiQueryBacklinks, MediaWiki\Api\ApiQueryBacklinksprop, MediaWiki\Api\ApiQueryBlocks, MediaWiki\Api\ApiQueryCategories, MediaWiki\Api\ApiQueryCategoryInfo, MediaWiki\Api\ApiQueryCategoryMembers, MediaWiki\Api\ApiQueryCodexIcons, MediaWiki\Api\ApiQueryContributors, MediaWiki\Api\ApiQueryDeletedRevisions, MediaWiki\Api\ApiQueryDeletedrevs, MediaWiki\Api\ApiQueryDuplicateFiles, MediaWiki\Api\ApiQueryExternalLinks, MediaWiki\Api\ApiQueryExtLinksUsage, MediaWiki\Api\ApiQueryFilearchive, MediaWiki\Api\ApiQueryFileRepoInfo, MediaWiki\Api\ApiQueryImageInfo, MediaWiki\Api\ApiQueryImages, MediaWiki\Api\ApiQueryInfo, MediaWiki\Api\ApiQueryIWBacklinks, MediaWiki\Api\ApiQueryIWLinks, MediaWiki\Api\ApiQueryLangBacklinks, MediaWiki\Api\ApiQueryLangLinks, MediaWiki\Api\ApiQueryLinks, MediaWiki\Api\ApiQueryLogEvents, MediaWiki\Api\ApiQueryMyStashedFiles, MediaWiki\Api\ApiQueryPagePropNames, MediaWiki\Api\ApiQueryPageProps, MediaWiki\Api\ApiQueryPagesWithProp, MediaWiki\Api\ApiQueryPrefixSearch, MediaWiki\Api\ApiQueryProtectedTitles, MediaWiki\Api\ApiQueryQueryPage, MediaWiki\Api\ApiQueryRandom, MediaWiki\Api\ApiQueryRecentChanges, MediaWiki\Api\ApiQueryRevisions, MediaWiki\Api\ApiQuerySearch, MediaWiki\Api\ApiQuerySiteinfo, MediaWiki\Api\ApiQueryStashImageInfo, MediaWiki\Api\ApiQueryTags, MediaWiki\Api\ApiQueryTokens, MediaWiki\Api\ApiQueryTrackingCategories, MediaWiki\Api\ApiQueryUserContribs, MediaWiki\Api\ApiQueryUserInfo, MediaWiki\Api\ApiQueryUsers, MediaWiki\Api\ApiQueryWatchlist, MediaWiki\Api\ApiQueryWatchlistRaw, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiRsd, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, MediaWiki\Api\ApiValidatePassword, and MediaWiki\Api\ApiWatch.
Definition at line 367 of file ApiBase.php.
|
protected |
Get a HookContainer, for running extension hooks or for hook metadata.
Definition at line 764 of file ApiBase.php.
References getHookContainer().
Referenced by getHookContainer(), getHookRunner(), MediaWiki\Api\ApiQueryRecentChanges\run(), and MediaWiki\Api\ApiQueryBase\select().
|
protected |
Get an ApiHookRunner for running core API hooks.
Definition at line 776 of file ApiBase.php.
References getHookContainer().
Referenced by MediaWiki\Api\ApiMain\__construct(), MediaWiki\Api\ApiQuery\__construct(), addDeprecation(), MediaWiki\Api\ApiQuerySiteinfo\appendStatistics(), MediaWiki\Api\ApiLogout\callUserLogoutComplete(), MediaWiki\Api\ApiMain\checkConditionalRequestHeaders(), MediaWiki\Api\ApiMain\checkExecutePermissions(), MediaWiki\Api\ApiFormatBase\closePrinter(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiOpenSearch\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiMain\executeAction(), MediaWiki\Api\ApiImport\getAllowedImportSources(), getFinalDescription(), getFinalParamDescription(), getFinalParams(), MediaWiki\Api\ApiRsd\getRsdApiList(), MediaWiki\Api\ApiMain\handleException(), MediaWiki\Api\ApiMain\lacksSameOriginSecurity(), logFeatureUsage(), MediaWiki\Api\ApiQueryBase\processRow(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiOptions\runHook(), and MediaWiki\Api\ApiQueryBase\select().
| MediaWiki\Api\ApiBase::getMain | ( | ) |
Get the main module.
Definition at line 574 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiContinuationManager\__construct(), MediaWiki\Api\ApiFormatBase\__construct(), MediaWiki\Api\ApiFormatJson\__construct(), addDeprecation(), MediaWiki\Api\ApiFormatBase\closePrinter(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiFeedRecentChanges\execute(), MediaWiki\Api\ApiFeedWatchlist\execute(), MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiOpenSearch\execute(), MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiParamInfo\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), getContinuationManager(), MediaWiki\Api\ApiFeedContributions\getCustomPrinter(), MediaWiki\Api\ApiFeedRecentChanges\getCustomPrinter(), MediaWiki\Api\ApiFeedWatchlist\getCustomPrinter(), MediaWiki\Api\ApiHelp\getCustomPrinter(), MediaWiki\Api\ApiOpenSearch\getCustomPrinter(), MediaWiki\Api\ApiQuery\getCustomPrinter(), MediaWiki\Api\ApiRsd\getCustomPrinter(), getErrorFormatter(), getModuleFromPath(), getParameterFromSettings(), getParent(), getResult(), MediaWiki\Api\ApiMain\getStatsFactory(), MediaWiki\Api\ApiFormatBase\initPrinter(), MediaWiki\Api\ApiFormatRaw\initPrinter(), lacksSameOriginSecurity(), logFeatureUsage(), MediaWiki\Api\ApiQueryRevisionsBase\parseParameters(), recordUnifiedMetrics(), requirePostedParameters(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiUpload\selectUploadModule(), setContinuationManager(), and MediaWiki\Api\ApiFormatBase\setHttpStatus().
| MediaWiki\Api\ApiBase::getModuleFromPath | ( | $path | ) |
Get a module from its module path.
| string | $path |
| ApiUsageException |
Definition at line 655 of file ApiBase.php.
References $path, dieWithError(), getMain(), and wfEscapeWikiText().
Referenced by MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiParamInfo\execute(), and getFinalParamDescription().
| MediaWiki\Api\ApiBase::getModuleManager | ( | ) |
Get the module manager, or null if this module has no submodules.
Reimplemented in MediaWiki\Api\ApiMain, and MediaWiki\Api\ApiQuery.
Definition at line 324 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiFormatBase\closePrinter(), MediaWiki\Api\ApiParamInfo\execute(), and getFinalParamDescription().
| MediaWiki\Api\ApiBase::getModuleName | ( | ) |
Get the name of the module being executed by this instance.
Definition at line 556 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiContinuationManager\__construct(), MediaWiki\Api\ApiContinuationManager\addContinueParam(), MediaWiki\Api\ApiContinuationManager\addGeneratorContinueParam(), MediaWiki\Api\ApiContinuationManager\addGeneratorNonContinueParam(), MediaWiki\Api\ApiQueryBase\addPageSubItem(), MediaWiki\Api\ApiQueryBase\addPageSubItems(), MediaWiki\Api\ApiAcquireTempUserName\execute(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiCheckToken\execute(), MediaWiki\Api\ApiClearHasMsg\execute(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiCSPReport\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiDisabled\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEmailUser\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiLanguageSearch\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiOptionsBase\execute(), MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQueryAllMessages\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryAuthManagerInfo\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryCodexIcons\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryDisabled\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryMyStashedFiles\execute(), MediaWiki\Api\ApiQueryPagePropNames\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), MediaWiki\Api\ApiQueryTags\execute(), MediaWiki\Api\ApiQueryTokens\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiQueryUserInfo\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiWatch\execute(), MediaWiki\Api\ApiQueryCategoryList\executeQuery(), MediaWiki\Api\ApiQueryBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinksprop\getAllowedParams(), MediaWiki\Api\ApiFormatBase\getExamplesMessages(), MediaWiki\Api\ApiQueryAllLinks\getExamplesMessages(), MediaWiki\Api\ApiQueryBacklinks\getExamplesMessages(), MediaWiki\Api\ApiQueryBacklinksprop\getExamplesMessages(), MediaWiki\Api\ApiQueryLanguageinfo\getExamplesMessages(), MediaWiki\Api\ApiQueryLinks\getExamplesMessages(), MediaWiki\Api\ApiRemoveAuthenticationData\getExamplesMessages(), MediaWiki\Api\ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), MediaWiki\Api\ApiClientLogin\getFinalDescription(), MediaWiki\Api\ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), MediaWiki\Api\ApiQueryAllLinks\getHelpUrls(), MediaWiki\Api\ApiQueryBacklinksprop\getHelpUrls(), getModulePath(), getParameterFromSettings(), MediaWiki\Api\ApiQueryRevisionsBase\parseParameters(), recordUnifiedMetrics(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryIWBacklinks\run(), MediaWiki\Api\ApiQueryLangBacklinks\run(), MediaWiki\Api\ApiQueryQueryPage\run(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiQueryRandom\runQuery(), and MediaWiki\Api\ApiUpload\selectUploadModule().
| MediaWiki\Api\ApiBase::getModulePath | ( | ) |
Get the path to this module.
Definition at line 635 of file ApiBase.php.
References getModuleName(), getParent(), and isMain().
Referenced by MediaWiki\Api\ApiUsageException\__construct(), addError(), addMessagesFromStatus(), addWarning(), MediaWiki\Api\ApiQueryAllLinks\getExamplesMessages(), MediaWiki\Api\ApiQueryBacklinksprop\getExamplesMessages(), MediaWiki\Api\ApiQueryLanguageinfo\getExamplesMessages(), MediaWiki\Api\ApiQueryLinks\getExamplesMessages(), MediaWiki\Api\ApiRemoveAuthenticationData\getExamplesMessages(), MediaWiki\Api\ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), MediaWiki\Api\ApiClientLogin\getFinalDescription(), MediaWiki\Api\ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), MediaWiki\Api\ApiHelp\getHelp(), and recordUnifiedMetrics().
| MediaWiki\Api\ApiBase::getModulePrefix | ( | ) |
Get parameter prefix (usually two letters or an empty string).
Definition at line 565 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQueryBase\addPageSubItem(), MediaWiki\Api\ApiQueryBase\addPageSubItems(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiQueryInfo\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), MediaWiki\Api\ApiQueryAllLinks\getExamplesMessages(), MediaWiki\Api\ApiQueryLanguageinfo\getExamplesMessages(), MediaWiki\Api\ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), MediaWiki\Api\ApiClientLogin\getFinalDescription(), MediaWiki\Api\ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), MediaWiki\Api\ApiQueryImageInfo\mergeThumbParams(), MediaWiki\Api\ApiQueryRevisionsBase\parseParameters(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), and MediaWiki\Api\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 2075 of file ApiBase.php.
References $path, MediaWiki\MainConfigNames\ExtensionDirectory, and MediaWiki\Context\ContextSource\getConfig().
|
protected |
Get a value for the given parameter.
| string | $paramName | Parameter name |
| bool | $parseLimit | See extractRequestParams() |
Definition at line 951 of file ApiBase.php.
References extractRequestParams().
Referenced by MediaWiki\Api\ApiFormatRaw\__construct(), MediaWiki\Api\ApiMain\addRequestedFields(), MediaWiki\Api\ApiQuerySiteinfo\appendSkins(), MediaWiki\Api\ApiCSPReport\execute(), MediaWiki\Api\ApiFeedRecentChanges\execute(), MediaWiki\Api\ApiLogout\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiOpenSearch\getCustomPrinter(), MediaWiki\Api\ApiQuery\getCustomPrinter(), MediaWiki\Api\ApiMain\handleCORS(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), MediaWiki\Api\ApiQueryRevisions\run(), MediaWiki\Api\ApiMain\sendCacheHeaders(), and MediaWiki\Api\ApiMain\setCacheMode().
|
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 MediaWiki\Api\ApiFormatBase.
Definition at line 1224 of file ApiBase.php.
References encodeParamName(), getMain(), getModuleName(), and getResult().
Referenced by extractRequestParams().
| MediaWiki\Api\ApiBase::getParent | ( | ) |
Get the parent of this module.
Reimplemented in MediaWiki\Api\ApiQueryBase.
Definition at line 595 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 755 of file ApiBase.php.
References getPermissionManager(), and return.
Referenced by MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiQueryAllUsers\getAllowedParams(), MediaWiki\Api\ApiQueryContributors\getAllowedParams(), getPermissionManager(), MediaWiki\Api\ApiTag\processIndividual(), and MediaWiki\Api\ApiMain\setCacheMode().
| MediaWiki\Api\ApiBase::getResult | ( | ) |
Get the result object.
Reimplemented in MediaWiki\Api\ApiMain.
Definition at line 695 of file ApiBase.php.
References getMain().
Referenced by MediaWiki\Api\ApiQueryBase\addPageSubItem(), MediaWiki\Api\ApiQueryBase\addPageSubItems(), MediaWiki\Api\ApiQuerySiteinfo\appendDefaultOptions(), MediaWiki\Api\ApiQuerySiteinfo\appendDoubleUnderscores(), MediaWiki\Api\ApiQuerySiteinfo\appendExtensionTags(), MediaWiki\Api\ApiQuerySiteinfo\appendFunctionHooks(), MediaWiki\Api\ApiQuerySiteinfo\appendProtocols(), MediaWiki\Api\ApiQuerySiteinfo\appendStatistics(), MediaWiki\Api\ApiQuerySiteinfo\appendUploadDialog(), MediaWiki\Api\ApiQuerySiteinfo\appendUserGroups(), MediaWiki\Api\ApiQuerySiteinfo\appendVariables(), MediaWiki\Api\ApiFormatRaw\closePrinter(), MediaWiki\Api\ApiAcquireTempUserName\execute(), MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiCheckToken\execute(), MediaWiki\Api\ApiClearHasMsg\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiCSPReport\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEmailUser\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiFeedContributions\execute(), MediaWiki\Api\ApiFeedRecentChanges\execute(), MediaWiki\Api\ApiFeedWatchlist\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiFormatFeedWrapper\execute(), MediaWiki\Api\ApiFormatJson\execute(), MediaWiki\Api\ApiFormatRaw\execute(), MediaWiki\Api\ApiFormatXml\execute(), MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiLanguageSearch\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiOpenSearchFormatJson\execute(), MediaWiki\Api\ApiOptionsBase\execute(), MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiQueryAllMessages\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryAuthManagerInfo\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryCodexIcons\execute(), MediaWiki\Api\ApiQueryContributors\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryFileRepoInfo\execute(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiQueryInfo\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryMyStashedFiles\execute(), MediaWiki\Api\ApiQueryPagePropNames\execute(), MediaWiki\Api\ApiQueryPageProps\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), MediaWiki\Api\ApiQueryTags\execute(), MediaWiki\Api\ApiQueryTokens\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiQueryUserInfo\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiResetPassword\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiRsd\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiWatch\execute(), MediaWiki\Api\ApiQueryCategoryList\executeQuery(), MediaWiki\Api\ApiFormatRaw\getFilename(), MediaWiki\Api\ApiFormatRaw\getMimeType(), getParameterFromSettings(), MediaWiki\Api\ApiFormatFeedWrapper\initPrinter(), MediaWiki\Api\ApiFormatRaw\initPrinter(), MediaWiki\Api\ApiQueryRevisionsBase\parseParameters(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryIWBacklinks\run(), MediaWiki\Api\ApiQueryLangBacklinks\run(), MediaWiki\Api\ApiQueryQueryPage\run(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiQueryRandom\runQuery(), and MediaWiki\Api\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 MediaWiki\Api\ApiDisabled, MediaWiki\Api\ApiQueryContributors, and MediaWiki\Api\ApiQueryDisabled.
Definition at line 1785 of file ApiBase.php.
Referenced by getFinalDescription(), and getFinalSummary().
| MediaWiki\Api\ApiBase::getTitleFromTitleOrPageId | ( | $params | ) |
Get a Title object from a title or pageid param, if it is possible.
It can die if no param is set or if the title or page ID is not valid.
| array | $params | User provided parameter set, as from $this->extractRequestParams() |
Definition at line 1192 of file ApiBase.php.
References dieWithError(), requireOnlyOneParameter(), and wfEscapeWikiText().
| MediaWiki\Api\ApiBase::getTitleOrPageId | ( | $params, | |
| $load = false ) |
Attempts to load a WikiPage object from a title or pageid parameter, if possible.
It can die if no param is set or if the title or page ID is not valid.
| array | $params | User provided parameter set, as from $this->extractRequestParams() |
| string | false | $load | Whether load the object's state from the database:
|
Definition at line 1154 of file ApiBase.php.
References dieWithError(), MediaWiki\MediaWikiServices\getInstance(), requireOnlyOneParameter(), and wfEscapeWikiText().
Referenced by MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), and MediaWiki\Api\ApiStashEdit\execute().
| MediaWiki\Api\ApiBase::getWatchlistUser | ( | $params | ) |
Gets the user for whom to get the watchlist.
| array | $params |
Definition at line 1300 of file ApiBase.php.
References checkUserRightsAny(), dieWithError(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Context\ContextSource\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 MediaWiki\Api\ApiLogout, and MediaWiki\Api\ApiUserrights.
Definition at line 524 of file ApiBase.php.
Referenced by validateToken().
| MediaWiki\Api\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 MediaWiki\Api\ApiPageSet.
Definition at line 1252 of file ApiBase.php.
References addWarning().
| MediaWiki\Api\ApiBase::isDeprecated | ( | ) |
Indicates whether this module is deprecated.
Consider overriding ::deprecationMsg() instead to provide a reason for the deprecation and a replacement.
Definition at line 462 of file ApiBase.php.
References deprecationMsg().
Referenced by getHelpFlags().
| MediaWiki\Api\ApiBase::isInternal | ( | ) |
Indicates whether this module is considered to be "internal".
Internal API modules are not (yet) intended for 3rd party use and may be unstable.
Reimplemented in MediaWiki\Api\ApiCSPReport, and MediaWiki\Api\ApiStashEdit.
Definition at line 487 of file ApiBase.php.
Referenced by getHelpFlags().
| MediaWiki\Api\ApiBase::isMain | ( | ) |
Returns true if this module is the main module ($this === $this->mMainModule), false otherwise.
Definition at line 584 of file ApiBase.php.
Referenced by __construct(), getFinalParamDescription(), getModulePath(), and getParent().
| MediaWiki\Api\ApiBase::isReadMode | ( | ) |
Indicates whether this module requires read rights.
Reimplemented in MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiCSPReport, MediaWiki\Api\ApiDisabled, MediaWiki\Api\ApiHelp, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiMain, MediaWiki\Api\ApiParamInfo, MediaWiki\Api\ApiQuery, MediaWiki\Api\ApiQueryAuthManagerInfo, MediaWiki\Api\ApiQueryTokens, and MediaWiki\Api\ApiRsd.
Definition at line 406 of file ApiBase.php.
Referenced by getHelpFlags().
| MediaWiki\Api\ApiBase::isWriteMode | ( | ) |
Indicates whether this module requires write access to the wiki.
API modules must override this method to return true if the operation they will perform is not "safe" per RFC 7231 section 4.2.1. A module's operation is "safe" if it is essentially read-only, i.e. the client does not request nor expect any state change that would be observable in the responses to future requests.
Implementations of this method must always return the same value, regardless of the parameters passed to the constructor or system state.
Modules that do not require POST requests should only perform "safe" operations. Note that some modules might require POST requests because they need to support large input parameters and not because they perform non-"safe" operations.
The information provided by this method is used to perform authorization checks. It can also be used to enforce proper routing of supposedly "safe" POST requests to the closest datacenter via the Promise-Non-Write-API-Action header.
Reimplemented in MediaWiki\Api\ApiAcquireTempUserName, MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiClearHasMsg, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOptionsBase, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiPurge, MediaWiki\Api\ApiQuery, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, and MediaWiki\Api\ApiWatch.
Definition at line 435 of file ApiBase.php.
Referenced by checkTitleUserPermissions(), getHelpFlags(), and MediaWiki\Api\ApiMain\setRequestExpectations().
| MediaWiki\Api\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 MediaWiki\Api\ApiMain.
Definition at line 622 of file ApiBase.php.
References getMain().
Referenced by MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), and MediaWiki\Api\ApiQueryTokens\execute().
| MediaWiki\Api\ApiBase::logFeatureUsage | ( | $feature | ) |
Write logging information for API features to a debug log, for usage analysis.
| string | $feature | Feature being used. |
Definition at line 1730 of file ApiBase.php.
References $request, getHookRunner(), getMain(), MediaWiki\Context\ContextSource\getRequest(), MediaWiki\Context\ContextSource\getUser(), wfDebugLog(), and wfUrlencode().
Referenced by addDeprecation(), and MediaWiki\Api\ApiValidatePassword\execute().
| MediaWiki\Api\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 SectionMetadata values. |
Reimplemented in MediaWiki\Api\ApiMain.
Definition at line 2158 of file ApiBase.php.
References wfDeprecated().
| MediaWiki\Api\ApiBase::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Implementations of this method must always return the same value, regardless of the parameters passed to the constructor or system state.
Reimplemented in MediaWiki\Api\ApiAcquireTempUserName, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiClearHasMsg, MediaWiki\Api\ApiCSPReport, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLogin, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOptionsBase, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiPurge, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, MediaWiki\Api\ApiValidatePassword, and MediaWiki\Api\ApiWatch.
Definition at line 448 of file ApiBase.php.
References needsToken().
Referenced by getHelpFlags(), and requirePostedParameters().
| MediaWiki\Api\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 MediaWiki\Api\ApiAMCreateAccount, MediaWiki\Api\ApiBlock, MediaWiki\Api\ApiChangeAuthenticationData, MediaWiki\Api\ApiChangeContentModel, MediaWiki\Api\ApiClientLogin, MediaWiki\Api\ApiDelete, MediaWiki\Api\ApiEditPage, MediaWiki\Api\ApiEmailUser, MediaWiki\Api\ApiFileRevert, MediaWiki\Api\ApiImageRotate, MediaWiki\Api\ApiImport, MediaWiki\Api\ApiLinkAccount, MediaWiki\Api\ApiLogout, MediaWiki\Api\ApiManageTags, MediaWiki\Api\ApiMergeHistory, MediaWiki\Api\ApiMove, MediaWiki\Api\ApiOptionsBase, MediaWiki\Api\ApiPatrol, MediaWiki\Api\ApiProtect, MediaWiki\Api\ApiRemoveAuthenticationData, MediaWiki\Api\ApiResetPassword, MediaWiki\Api\ApiRevisionDelete, MediaWiki\Api\ApiRollback, MediaWiki\Api\ApiSetNotificationTimestamp, MediaWiki\Api\ApiSetPageLanguage, MediaWiki\Api\ApiStashEdit, MediaWiki\Api\ApiTag, MediaWiki\Api\ApiUnblock, MediaWiki\Api\ApiUndelete, MediaWiki\Api\ApiUpload, MediaWiki\Api\ApiUserrights, and MediaWiki\Api\ApiWatch.
Definition at line 510 of file ApiBase.php.
Referenced by getFinalParams(), mustBePosted(), and validateToken().
|
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 the 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 1667 of file ApiBase.php.
References dieContinueUsageIf(), and getDB().
Referenced by MediaWiki\Api\ApiQueryCategoryList\createQuery(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryContributors\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryExternalLinks\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiQueryInfo\execute(), MediaWiki\Api\ApiQueryIWLinks\execute(), MediaWiki\Api\ApiQueryLangLinks\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryMyStashedFiles\execute(), MediaWiki\Api\ApiQueryPagePropNames\execute(), MediaWiki\Api\ApiQueryPageProps\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), MediaWiki\Api\ApiQueryIWBacklinks\run(), MediaWiki\Api\ApiQueryLangBacklinks\run(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), and MediaWiki\Api\ApiQueryRevisions\run().
|
protected |
Record unified metrics for the API.
| array | $detailLabels | Additional or override labels for the metrics |
Definition at line 2173 of file ApiBase.php.
References $path, getMain(), getModuleName(), getModulePath(), and MediaWiki\Context\ContextSource\getRequest().
Referenced by MediaWiki\Api\ApiMain\executeActionWithErrorHandling(), and MediaWiki\Api\ApiMain\handleException().
| MediaWiki\Api\ApiBase::requireAtLeastOneParameter | ( | $params, | |
| ... ) |
Die if 0 of a certain set of parameters is set and not false.
| array | $params | User provided parameters set, as from $this->extractRequestParams() |
| string | ...$required Names of parameters of which at least one must be set |
Definition at line 1032 of file ApiBase.php.
References dieWithError(), encodeParamName(), and MediaWiki\Message\Message\listParam().
Referenced by MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), and MediaWiki\Api\ApiTag\execute().
| MediaWiki\Api\ApiBase::requireMaxOneParameter | ( | $params, | |
| ... ) |
Dies if more than one parameter from a certain set of parameters are set and not false.
| array | $params | User provided parameters set, as from $this->extractRequestParams() |
| string | ...$required Parameter names that cannot have more than one set |
Definition at line 1005 of file ApiBase.php.
References dieWithError(), encodeParamName(), and MediaWiki\Message\Message\listParam().
Referenced by MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryContributors\execute(), MediaWiki\Api\ApiQueryIWLinks\execute(), MediaWiki\Api\ApiQueryLangLinks\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), MediaWiki\Api\ApiQueryRandom\run(), MediaWiki\Api\ApiQueryRecentChanges\run(), and MediaWiki\Api\ApiQueryRevisions\run().
| MediaWiki\Api\ApiBase::requireNoConflictingParameters | ( | $params, | |
| $trigger, | |||
| $conflicts ) |
Die with an "invalid param mix" error if the parameters contain the trigger parameter and any of the conflicting parameters.
| array | $params | User provided parameters set, as from $this->extractRequestParams() |
| string | $trigger | The name of the trigger parameter |
| string | string[] | $conflicts | The conflicting parameter or a list of conflicting parameters |
Definition at line 1063 of file ApiBase.php.
References dieWithError(), encodeParamName(), and MediaWiki\Message\Message\listParam().
Referenced by MediaWiki\Api\ApiBlock\execute().
| MediaWiki\Api\ApiBase::requireOnlyOneParameter | ( | $params, | |
| ... ) |
Die if 0 or more than one of a certain set of parameters is set and not false.
| array | $params | User provided parameter set, as from $this->extractRequestParams() |
| string | ...$required Names of parameters of which exactly one must be set |
Definition at line 968 of file ApiBase.php.
References dieWithError(), encodeParamName(), and MediaWiki\Message\Message\listParam().
Referenced by MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiQueryUserContribs\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiUnblock\execute(), getTitleFromTitleOrPageId(), getTitleOrPageId(), and MediaWiki\Api\ApiUpload\selectUploadModule().
| MediaWiki\Api\ApiBase::requirePostedParameters | ( | $params, | |
| $prefix = 'prefix' ) |
Die if any of the specified parameters were found in the query part of the URL rather than the HTTP post body contents.
| string[] | $params | Parameters to check |
| string | $prefix | Set to 'noprefix' to skip calling $this->encodeParamName() |
Definition at line 1094 of file ApiBase.php.
References MediaWiki\MainConfigNames\DebugAPI, dieWithError(), encodeParamName(), MediaWiki\Context\ContextSource\getConfig(), getMain(), MediaWiki\Context\ContextSource\getRequest(), mustBePosted(), and wfDeprecatedMsg().
Referenced by MediaWiki\Api\ApiLogin\execute(), and MediaWiki\Api\ApiValidatePassword\execute().
| MediaWiki\Api\ApiBase::setContinuationManager | ( | ?ApiContinuationManager | $manager = null | ) |
| ApiContinuationManager | null | $manager |
Reimplemented in MediaWiki\Api\ApiMain.
Definition at line 742 of file ApiBase.php.
References getMain().
Referenced by MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), and MediaWiki\Api\ApiWatch\execute().
| MediaWiki\Api\ApiBase::shouldCheckMaxlag | ( | ) |
Indicates if this module needs maxlag to be checked.
Reimplemented in MediaWiki\Api\ApiHelp, and MediaWiki\Api\ApiQueryCodexIcons.
Definition at line 396 of file ApiBase.php.
|
protected |
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition at line 1329 of file ApiBase.php.
References MediaWiki\Context\ContextSource\getRequest(), and wfTransactionalTimeLimit().
Referenced by MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiMergeHistory\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiUndelete\execute(), and MediaWiki\Api\ApiUpload\execute().
|
final |
Validate the supplied token.
| string | $token | Supplied token |
| array | $params | All supplied parameters for the module |
Definition at line 1264 of file ApiBase.php.
References MediaWiki\Context\ContextSource\getRequest(), MediaWiki\Api\ApiQueryTokens\getToken(), MediaWiki\Api\ApiQueryTokens\getTokenTypeSalts(), MediaWiki\Context\ContextSource\getUser(), getWebUITokenSalt(), and needsToken().
| const MediaWiki\Api\ApiBase::ALL_DEFAULT_STRING = '*' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Default is apihelp-{$path}-param-{$param}. See Message::newFromSpecifier() for a description of allowed values.
Definition at line 227 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::GET_VALUES_FOR_HELP = 1 |
getAllowedParams() flag: When this is 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 243 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiPageSet\getAllowedParams(), MediaWiki\Api\ApiQueryAllUsers\getAllowedParams(), MediaWiki\Api\ApiQueryContributors\getAllowedParams(), MediaWiki\Api\ApiQueryLogEvents\getAllowedParams(), and MediaWiki\Api\ApiUserrights\getAllowedParams().
| const MediaWiki\Api\ApiBase::LIMIT_BIG1 = 500 |
Fast query, standard limit.
Definition at line 230 of file ApiBase.php.
Referenced by MediaWiki\Api\buildCommonApiParams(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryAllCategories\getAllowedParams(), MediaWiki\Api\ApiQueryAllImages\getAllowedParams(), MediaWiki\Api\ApiQueryAllLinks\getAllowedParams(), MediaWiki\Api\ApiQueryAllPages\getAllowedParams(), MediaWiki\Api\ApiQueryAllUsers\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinksprop\getAllowedParams(), MediaWiki\Api\ApiQueryBlocks\getAllowedParams(), MediaWiki\Api\ApiQueryCategories\getAllowedParams(), MediaWiki\Api\ApiQueryCategoryMembers\getAllowedParams(), MediaWiki\Api\ApiQueryContributors\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryDuplicateFiles\getAllowedParams(), MediaWiki\Api\ApiQueryExternalLinks\getAllowedParams(), MediaWiki\Api\ApiQueryExtLinksUsage\getAllowedParams(), MediaWiki\Api\ApiQueryFilearchive\getAllowedParams(), MediaWiki\Api\ApiQueryImageInfo\getAllowedParams(), MediaWiki\Api\ApiQueryImages\getAllowedParams(), MediaWiki\Api\ApiQueryIWBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryIWLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLogEvents\getAllowedParams(), MediaWiki\Api\ApiQueryMyStashedFiles\getAllowedParams(), MediaWiki\Api\ApiQueryPagePropNames\getAllowedParams(), MediaWiki\Api\ApiQueryPagesWithProp\getAllowedParams(), MediaWiki\Api\ApiQueryProtectedTitles\getAllowedParams(), MediaWiki\Api\ApiQueryQueryPage\getAllowedParams(), MediaWiki\Api\ApiQueryRandom\getAllowedParams(), MediaWiki\Api\ApiQueryRecentChanges\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), MediaWiki\Api\ApiQueryTags\getAllowedParams(), MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams(), MediaWiki\Api\ApiQueryUserContribs\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlist\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlistRaw\getAllowedParams(), MediaWiki\Api\ApiMain\modifyHelp(), and MediaWiki\Api\ApiQueryRevisionsBase\parseParameters().
| const MediaWiki\Api\ApiBase::LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit.
Definition at line 232 of file ApiBase.php.
Referenced by MediaWiki\Api\buildCommonApiParams(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryAllCategories\getAllowedParams(), MediaWiki\Api\ApiQueryAllImages\getAllowedParams(), MediaWiki\Api\ApiQueryAllLinks\getAllowedParams(), MediaWiki\Api\ApiQueryAllPages\getAllowedParams(), MediaWiki\Api\ApiQueryAllUsers\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinksprop\getAllowedParams(), MediaWiki\Api\ApiQueryBlocks\getAllowedParams(), MediaWiki\Api\ApiQueryCategories\getAllowedParams(), MediaWiki\Api\ApiQueryCategoryMembers\getAllowedParams(), MediaWiki\Api\ApiQueryContributors\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryDuplicateFiles\getAllowedParams(), MediaWiki\Api\ApiQueryExternalLinks\getAllowedParams(), MediaWiki\Api\ApiQueryExtLinksUsage\getAllowedParams(), MediaWiki\Api\ApiQueryFilearchive\getAllowedParams(), MediaWiki\Api\ApiQueryImageInfo\getAllowedParams(), MediaWiki\Api\ApiQueryImages\getAllowedParams(), MediaWiki\Api\ApiQueryIWBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryIWLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLogEvents\getAllowedParams(), MediaWiki\Api\ApiQueryMyStashedFiles\getAllowedParams(), MediaWiki\Api\ApiQueryPagePropNames\getAllowedParams(), MediaWiki\Api\ApiQueryPagesWithProp\getAllowedParams(), MediaWiki\Api\ApiQueryProtectedTitles\getAllowedParams(), MediaWiki\Api\ApiQueryQueryPage\getAllowedParams(), MediaWiki\Api\ApiQueryRandom\getAllowedParams(), MediaWiki\Api\ApiQueryRecentChanges\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), MediaWiki\Api\ApiQueryTags\getAllowedParams(), MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams(), MediaWiki\Api\ApiQueryUserContribs\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlist\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlistRaw\getAllowedParams(), MediaWiki\Api\ApiMain\modifyHelp(), and MediaWiki\Api\ApiQueryRevisionsBase\parseParameters().
| const MediaWiki\Api\ApiBase::LIMIT_SML1 = 50 |
Slow query, standard limit.
Definition at line 234 of file ApiBase.php.
Referenced by MediaWiki\Api\Validator\ApiParamValidator\__construct(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), MediaWiki\Api\ApiMain\modifyHelp(), and MediaWiki\Api\ApiQueryRevisionsBase\parseParameters().
| const MediaWiki\Api\ApiBase::LIMIT_SML2 = 500 |
Slow query, apihighlimits limit.
Definition at line 236 of file ApiBase.php.
Referenced by MediaWiki\Api\Validator\ApiParamValidator\__construct(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), MediaWiki\Api\ApiMain\modifyHelp(), and MediaWiki\Api\ApiQueryRevisionsBase\parseParameters().
| const MediaWiki\Api\ApiBase::PARAM_ALL = ParamValidator::PARAM_ALL |
Definition at line 119 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_ALLOW_DUPLICATES = ParamValidator::PARAM_ALLOW_DUPLICATES |
Definition at line 99 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_DEPRECATED = ParamValidator::PARAM_DEPRECATED |
Definition at line 103 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_DEPRECATED_VALUES = EnumDef::PARAM_DEPRECATED_VALUES |
Definition at line 131 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_DFLT = ParamValidator::PARAM_DEFAULT |
Definition at line 75 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_EXTRA_NAMESPACES = NamespaceDef::PARAM_EXTRA_NAMESPACES |
Definition at line 123 of file ApiBase.php.
| const MediaWiki\Api\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}. See Message::newFromSpecifier() for a description of allowed values.
Definition at line 165 of file ApiBase.php.
Referenced by MediaWiki\Api\buildCommonApiParams(), MediaWiki\Api\ApiFeedContributions\getAllowedParams(), MediaWiki\Api\ApiFeedRecentChanges\getAllowedParams(), MediaWiki\Api\ApiFeedWatchlist\getAllowedParams(), MediaWiki\Api\ApiFormatBase\getAllowedParams(), MediaWiki\Api\ApiFormatJson\getAllowedParams(), MediaWiki\Api\ApiFormatXml\getAllowedParams(), MediaWiki\Api\ApiImageRotate\getAllowedParams(), MediaWiki\Api\ApiLogin\getAllowedParams(), MediaWiki\Api\ApiPageSet\getAllowedParams(), MediaWiki\Api\ApiParse\getAllowedParams(), MediaWiki\Api\ApiPurge\getAllowedParams(), MediaWiki\Api\ApiQuery\getAllowedParams(), MediaWiki\Api\ApiQueryAllCategories\getAllowedParams(), MediaWiki\Api\ApiQueryAllDeletedRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryAllImages\getAllowedParams(), MediaWiki\Api\ApiQueryAllLinks\getAllowedParams(), MediaWiki\Api\ApiQueryAllPages\getAllowedParams(), MediaWiki\Api\ApiQueryAllRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryAllUsers\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinksprop\getAllowedParams(), MediaWiki\Api\ApiQueryBlocks\getAllowedParams(), MediaWiki\Api\ApiQueryCategories\getAllowedParams(), MediaWiki\Api\ApiQueryCategoryInfo\getAllowedParams(), MediaWiki\Api\ApiQueryCategoryMembers\getAllowedParams(), MediaWiki\Api\ApiQueryContributors\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryDuplicateFiles\getAllowedParams(), MediaWiki\Api\ApiQueryExternalLinks\getAllowedParams(), MediaWiki\Api\ApiQueryExtLinksUsage\getAllowedParams(), MediaWiki\Api\ApiQueryFilearchive\getAllowedParams(), MediaWiki\Api\ApiQueryImageInfo\getAllowedParams(), MediaWiki\Api\ApiQueryImages\getAllowedParams(), MediaWiki\Api\ApiQueryInfo\getAllowedParams(), MediaWiki\Api\ApiQueryIWBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryIWLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLogEvents\getAllowedParams(), MediaWiki\Api\ApiQueryMyStashedFiles\getAllowedParams(), MediaWiki\Api\ApiQueryPagePropNames\getAllowedParams(), MediaWiki\Api\ApiQueryPageProps\getAllowedParams(), MediaWiki\Api\ApiQueryPagesWithProp\getAllowedParams(), MediaWiki\Api\ApiQueryProtectedTitles\getAllowedParams(), MediaWiki\Api\ApiQueryQueryPage\getAllowedParams(), MediaWiki\Api\ApiQueryRandom\getAllowedParams(), MediaWiki\Api\ApiQueryRecentChanges\getAllowedParams(), MediaWiki\Api\ApiQueryRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), MediaWiki\Api\ApiQueryStashImageInfo\getAllowedParams(), MediaWiki\Api\ApiQueryTags\getAllowedParams(), MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams(), MediaWiki\Api\ApiQueryUserContribs\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlist\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlistRaw\getAllowedParams(), MediaWiki\Api\ApiSetNotificationTimestamp\getAllowedParams(), MediaWiki\Api\ApiWatch\getAllowedParams(), and MediaWiki\Api\ApiAuthManagerHelper\getStandardParams().
| const MediaWiki\Api\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.
See Message::newFromSpecifier() for a description of allowed values.
Definition at line 173 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiAMCreateAccount\getAllowedParams(), MediaWiki\Api\ApiEditPage\getAllowedParams(), MediaWiki\Api\ApiOpenSearch\getAllowedParams(), MediaWiki\Api\ApiQueryAllDeletedRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryAllPages\getAllowedParams(), MediaWiki\Api\ApiQueryAllRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinksprop\getAllowedParams(), MediaWiki\Api\ApiQueryCategoryMembers\getAllowedParams(), MediaWiki\Api\ApiQueryExtLinksUsage\getAllowedParams(), MediaWiki\Api\ApiRollback\getAllowedParams(), and MediaWiki\Api\ApiUserrights\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_HELP_MSG_INFO = 'api-param-help-msg-info' |
(array) Specify additional information tags for the parameter.
The 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 MediaWiki\Api\ApiQueryAllDeletedRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryInfo\getAllowedParams(), and MediaWiki\Api\ApiQueryRevisions\getAllowedParams().
| const MediaWiki\Api\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 messages.
See Message::newFromSpecifier() for a description of allowed 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 205 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiComparePages\getAllowedParams(), MediaWiki\Api\ApiExpandTemplates\getAllowedParams(), MediaWiki\Api\ApiFeedWatchlist\getAllowedParams(), MediaWiki\Api\ApiFormatJson\getAllowedParams(), MediaWiki\Api\ApiMain\getAllowedParams(), MediaWiki\Api\ApiManageTags\getAllowedParams(), MediaWiki\Api\ApiOpenSearch\getAllowedParams(), MediaWiki\Api\ApiParse\getAllowedParams(), MediaWiki\Api\ApiQueryAllCategories\getAllowedParams(), MediaWiki\Api\ApiQueryAllDeletedRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryAllImages\getAllowedParams(), MediaWiki\Api\ApiQueryAllLinks\getAllowedParams(), MediaWiki\Api\ApiQueryAllPages\getAllowedParams(), MediaWiki\Api\ApiQueryAllRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryAllUsers\getAllowedParams(), MediaWiki\Api\ApiQueryBacklinksprop\getAllowedParams(), MediaWiki\Api\ApiQueryBlocks\getAllowedParams(), MediaWiki\Api\ApiQueryCategories\getAllowedParams(), MediaWiki\Api\ApiQueryCategoryMembers\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryDeletedrevs\getAllowedParams(), MediaWiki\Api\ApiQueryExtLinksUsage\getAllowedParams(), MediaWiki\Api\ApiQueryFilearchive\getAllowedParams(), MediaWiki\Api\ApiQueryFileRepoInfo\getAllowedParams(), MediaWiki\Api\ApiQueryImageInfo\getAllowedParams(), MediaWiki\Api\ApiQueryInfo\getAllowedParams(), MediaWiki\Api\ApiQueryIWBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryIWLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangBacklinks\getAllowedParams(), MediaWiki\Api\ApiQueryLangLinks\getAllowedParams(), MediaWiki\Api\ApiQueryLogEvents\getAllowedParams(), MediaWiki\Api\ApiQueryMyStashedFiles\getAllowedParams(), MediaWiki\Api\ApiQueryPagesWithProp\getAllowedParams(), MediaWiki\Api\ApiQueryProtectedTitles\getAllowedParams(), MediaWiki\Api\ApiQueryRecentChanges\getAllowedParams(), MediaWiki\Api\ApiQueryRevisions\getAllowedParams(), MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams(), MediaWiki\Api\ApiQuerySearch\getAllowedParams(), MediaWiki\Api\ApiQuerySiteinfo\getAllowedParams(), MediaWiki\Api\ApiQueryStashImageInfo\getAllowedParams(), MediaWiki\Api\ApiQueryTags\getAllowedParams(), MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams(), MediaWiki\Api\ApiQueryUserContribs\getAllowedParams(), MediaWiki\Api\ApiQueryUserInfo\getAllowedParams(), MediaWiki\Api\ApiQueryUsers\getAllowedParams(), MediaWiki\Api\ApiQueryWatchlist\getAllowedParams(), and MediaWiki\Api\ApiQueryWatchlistRaw\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_ISMULTI = ParamValidator::PARAM_ISMULTI |
Definition at line 79 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_ISMULTI_LIMIT1 = ParamValidator::PARAM_ISMULTI_LIMIT1 |
Definition at line 135 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_ISMULTI_LIMIT2 = ParamValidator::PARAM_ISMULTI_LIMIT2 |
Definition at line 139 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_MAX = IntegerDef::PARAM_MAX |
Definition at line 87 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_MAX2 = IntegerDef::PARAM_MAX2 |
Definition at line 91 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_MAX_BYTES = StringDef::PARAM_MAX_BYTES |
Definition at line 143 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_MAX_CHARS = StringDef::PARAM_MAX_CHARS |
Definition at line 147 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_MIN = IntegerDef::PARAM_MIN |
Definition at line 95 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_RANGE_ENFORCE = 'api-param-range-enforce' |
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE
Definition at line 154 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiEditPage\getAllowedParams(), and MediaWiki\Api\Validator\ApiParamValidator\normalizeSettings().
| const MediaWiki\Api\ApiBase::PARAM_REQUIRED = ParamValidator::PARAM_REQUIRED |
Definition at line 107 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiLanguageSearch\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_SENSITIVE = ParamValidator::PARAM_SENSITIVE |
Definition at line 127 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_SUBMODULE_MAP = SubmoduleDef::PARAM_SUBMODULE_MAP |
Definition at line 111 of file ApiBase.php.
| const MediaWiki\Api\ApiBase::PARAM_SUBMODULE_PARAM_PREFIX = SubmoduleDef::PARAM_SUBMODULE_PARAM_PREFIX |
Definition at line 115 of file ApiBase.php.
| const MediaWiki\Api\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 223 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiComparePages\getAllowedParams(), and MediaWiki\Api\ApiQueryRevisionsBase\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_TYPE = ParamValidator::PARAM_TYPE |
Definition at line 83 of file ApiBase.php.
Referenced by MediaWiki\Api\ApiClientLogin\getAllowedParams(), MediaWiki\Api\ApiLanguageSearch\getAllowedParams(), MediaWiki\Api\ApiQueryAuthManagerInfo\getAllowedParams(), and MediaWiki\Api\ApiQueryTrackingCategories\getAllowedParams().
| const MediaWiki\Api\ApiBase::PARAM_VALUE_LINKS = 'api-param-value-links' |