MediaWiki
1.34.0
|
This abstract class implements many basic API functions, and is the base of all API classes. More...
Inherits ContextSource.
Inherited by ApiAMCreateAccount, ApiBlock, ApiCategoryTree, ApiChangeAuthenticationData, ApiCheckToken, ApiClearHasMsg, ApiClientLogin, ApiComparePages, ApiCSPReport, ApiDelete, ApiDisabled, ApiEditPage, ApiEmailUser, ApiExpandTemplates, ApiFancyCaptchaReload, ApiFeedContributions, ApiFeedRecentChanges, ApiFeedWatchlist, ApiFileRevert, ApiFormatBase, ApiHelp, ApiImageRotate, ApiImport, ApiLinkAccount, ApiLogin, ApiLogout, ApiMain, ApiManageTags, ApiMergeHistory, ApiMove, ApiOpenSearch, ApiOptions, ApiPageSet, ApiParamInfo, ApiParse, ApiPatrol, ApiProtect, ApiPurge, ApiQuery, ApiQueryBase, ApiQueryTitleBlacklist, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiRsd, ApiScribuntoConsole, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiSpamBlacklist, ApiStashEdit, ApiTag, ApiTokens, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, ApiWatch, and MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate.
Public Member Functions | |
__construct (ApiMain $mainModule, $moduleName, $modulePrefix='') | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). More... | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. More... | |
getConfig () | |
getContext () | |
Get the base IContextSource object. More... | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
Public Attributes | |
string | $mModulePrefix |
const | ALL_DEFAULT_STRING = '*' |
const | GET_VALUES_FOR_HELP = 1 |
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thorough. More... | |
const | LIMIT_BIG1 = 500 |
Fast query, standard limit. More... | |
const | LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit. More... | |
const | LIMIT_SML1 = 50 |
Slow query, standard limit. More... | |
const | LIMIT_SML2 = 500 |
Slow query, apihighlimits limit. More... | |
Constants for ::getAllowedParams() arrays | |
These constants are keys in the arrays returned by ::getAllowedParams() and accepted by ::getParameterFromSettings() that define how the parameters coming in from the request are to be interpreted. | |
const | PARAM_DFLT = 0 |
(null|boolean|integer|string) Default value of the parameter. More... | |
const | PARAM_ISMULTI = 1 |
(boolean) Accept multiple pipe-separated values for this parameter (e.g. More... | |
const | PARAM_TYPE = 2 |
(string|string[]) Either an array of allowed value strings, or a string type as described below. More... | |
const | PARAM_MAX = 3 |
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'. More... | |
const | PARAM_MAX2 = 4 |
(integer) Max value allowed for the parameter for users with the apihighlimits right, for PARAM_TYPE 'limit'. More... | |
const | PARAM_MIN = 5 |
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'. More... | |
const | PARAM_ALLOW_DUPLICATES = 6 |
(boolean) Allow the same value to be set more than once when PARAM_ISMULTI is true? More... | |
const | PARAM_DEPRECATED = 7 |
(boolean) Is the parameter deprecated (will show a warning)? More... | |
const | PARAM_REQUIRED = 8 |
(boolean) Is the parameter required? More... | |
const | PARAM_RANGE_ENFORCE = 9 |
(boolean) For PARAM_TYPE 'integer', enforce PARAM_MIN and PARAM_MAX? More... | |
const | PARAM_HELP_MSG = 10 |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. More... | |
const | PARAM_HELP_MSG_APPEND = 11 |
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this parameter. More... | |
const | PARAM_HELP_MSG_INFO = 12 |
(array) Specify additional information tags for the parameter. More... | |
const | PARAM_VALUE_LINKS = 13 |
(string[]) When PARAM_TYPE is an array, this may be an array mapping those values to page titles which will be linked in the help. More... | |
const | PARAM_HELP_MSG_PER_VALUE = 14 |
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg for ApiBase::makeMessage(). More... | |
const | PARAM_SUBMODULE_MAP = 15 |
(string[]) When PARAM_TYPE is 'submodule', map parameter values to submodule paths. More... | |
const | PARAM_SUBMODULE_PARAM_PREFIX = 16 |
(string) When PARAM_TYPE is 'submodule', used to indicate the 'g' prefix added by ApiQueryGeneratorBase (and similar if anything else ever does that). More... | |
const | PARAM_ALL = 17 |
(boolean|string) When PARAM_TYPE has a defined set of values and PARAM_ISMULTI is true, this allows for an asterisk ('*') to be passed in place of a pipe-separated list of every possible value. More... | |
const | PARAM_EXTRA_NAMESPACES = 18 |
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values. More... | |
const | PARAM_SENSITIVE = 19 |
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of the value of this field. More... | |
const | PARAM_DEPRECATED_VALUES = 20 |
(array) When PARAM_TYPE is an array, this indicates which of the values are deprecated. More... | |
const | PARAM_ISMULTI_LIMIT1 = 21 |
(integer) Maximum number of values, for normal users. More... | |
const | PARAM_ISMULTI_LIMIT2 = 22 |
(integer) Maximum number of values, for users with the apihighimits right. More... | |
const | PARAM_MAX_BYTES = 23 |
(integer) Maximum length of a string in bytes (in UTF-8 encoding). More... | |
const | PARAM_MAX_CHARS = 24 |
(integer) Maximum length of a string in characters (unicode codepoints). More... | |
const | PARAM_TEMPLATE_VARS = 25 |
(array) Indicate that this is a templated parameter, and specify replacements. More... | |
Private Attributes | |
ApiMain | $mMainModule |
string | $mModuleName |
array null bool | $mModuleSource = false |
$mParamCache = [] | |
$mReplicaDB = null | |
Static Private Attributes | |
static | $blockMsgMap |
$var array Map of web UI block messages to corresponding API messages and codes More... | |
static array | $extensionInfo = null |
Maps extension paths to info arrays. More... | |
static stdClass[][] | $filterIDsCache = [] |
Cache for self::filterIDs() More... | |
Methods to implement | |
execute () | |
Evaluates the parameters, performs the requested query, and sets up the result. More... | |
getModuleManager () | |
Get the module manager, or null if this module has no sub-modules. More... | |
getCustomPrinter () | |
If the module may only be used with a certain format module, it should override this method to return an instance of that formatter. More... | |
getHelpUrls () | |
Return links to more detailed help pages about the module. More... | |
shouldCheckMaxlag () | |
Indicates if this module needs maxlag to be checked. More... | |
isReadMode () | |
Indicates whether this module requires read rights. More... | |
isWriteMode () | |
Indicates whether this module requires write mode. More... | |
mustBePosted () | |
Indicates whether this module must be called with a POST request. More... | |
isDeprecated () | |
Indicates whether this module is deprecated. More... | |
isInternal () | |
Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party use and may be unstable. More... | |
needsToken () | |
Returns the token type this module requires in order to execute. More... | |
getConditionalRequestData ( $condition) | |
Returns data for HTTP conditional request mechanisms. More... | |
getExamplesMessages () | |
Returns usage examples for this module. More... | |
getAllowedParams () | |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed. More... | |
getWebUITokenSalt (array $params) | |
Fetch the salt used in the Web UI corresponding to this module. More... | |
Data access methods | |
getModuleName () | |
Get the name of the module being executed by this instance. More... | |
getModulePrefix () | |
Get parameter prefix (usually two letters or an empty string). More... | |
getMain () | |
Get the main module. More... | |
isMain () | |
Returns true if this module is the main module ($this === $this->mMainModule), false otherwise. More... | |
getParent () | |
Get the parent of this module. More... | |
lacksSameOriginSecurity () | |
Returns true if the current request breaks the same-origin policy. More... | |
getModulePath () | |
Get the path to this module. More... | |
getModuleFromPath ( $path) | |
Get a module from its module path. More... | |
getResult () | |
Get the result object. More... | |
getErrorFormatter () | |
Get the error formatter. More... | |
getContinuationManager () | |
Get the continuation manager. More... | |
setContinuationManager (ApiContinuationManager $manager=null) | |
Set the continuation manager. More... | |
getDB () | |
Gets a default replica DB connection object. More... | |
getPermissionManager () | |
Obtain a PermissionManager instance that subclasses may use in their authorization checks. More... | |
Parameter handling | |
dynamicParameterDocumentation () | |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams(). More... | |
encodeParamName ( $paramName) | |
This method mangles parameter name based on the prefix supplied to the constructor. More... | |
extractRequestParams ( $options=[]) | |
Using getAllowedParams(), this function makes an array of the values provided by the user, with key being the name of the variable, and value - validated value from user or default. More... | |
requireOnlyOneParameter ( $params, $required) | |
Die if none or more than one of a certain set of parameters is set and not false. More... | |
requireMaxOneParameter ( $params, $required) | |
Die if more than one of a certain set of parameters is set and not false. More... | |
requireAtLeastOneParameter ( $params, $required) | |
Die if none of a certain set of parameters is set and not false. More... | |
requirePostedParameters ( $params, $prefix='prefix') | |
Die if any of the specified parameters were found in the query part of the URL rather than the post body. More... | |
getTitleOrPageId ( $params, $load=false) | |
Get a WikiPage object from a title or pageid param, if possible. More... | |
getTitleFromTitleOrPageId ( $params) | |
Get a Title object from a title or pageid param, if possible. More... | |
validateToken ( $token, array $params) | |
Validate the supplied token. More... | |
getParameter ( $paramName, $parseLimit=true) | |
Get a value for the given parameter. More... | |
getWatchlistValue ( $watchlist, $titleObj, $userOption=null) | |
Return true if we're to watch the page, false if not, null if no change. More... | |
getParameterFromSettings ( $paramName, $paramSettings, $parseLimit) | |
Using the settings determine the value for the given parameter. More... | |
handleParamNormalization ( $paramName, $value, $rawValue) | |
Handle when a parameter was Unicode-normalized. More... | |
explodeMultiValue ( $value, $limit) | |
Split a multi-valued parameter string, like explode() More... | |
parseMultiValue ( $valueName, $value, $allowMultiple, $allowedValues, $allSpecifier=null, $limit1=null, $limit2=null) | |
Return an array of values that were given in a 'a|b|c' notation, after it optionally validates them against the list allowed values. More... | |
validateLimit ( $paramName, &$value, $min, $max, $botMax=null, $enforceLimits=false) | |
Validate the value against the minimum and user/bot maximum limits. More... | |
validateTimestamp ( $value, $encParamName) | |
Validate and normalize parameters of type 'timestamp'. More... | |
parameterNotEmpty ( $x) | |
Callback function used in requireOnlyOneParameter to check whether required parameters are set. More... | |
validateUser ( $value, $encParamName) | |
Validate and normalize parameters of type 'user'. More... | |
Utility methods | |
getWatchlistUser ( $params) | |
Gets the user for whom to get the watchlist. More... | |
errorArrayToStatus (array $errors, User $user=null) | |
Turn an array of message keys or key+param arrays into a Status. More... | |
addBlockInfoToStatus (StatusValue $status, User $user=null) | |
Add block info to block messages in a Status. More... | |
setWatch ( $watch, $titleObj, $userOption=null) | |
Set a watch (or unwatch) based the based on a watchlist parameter. More... | |
useTransactionalTimeLimit () | |
Call wfTransactionalTimeLimit() if this request was POSTed. More... | |
filterIDs ( $fields, array $ids) | |
Filter out-of-range values from a list of positive integer IDs. More... | |
static | makeMessage ( $msg, IContextSource $context, array $params=null) |
Create a Message from a string or array. More... | |
Warning and error reporting | |
addWarning ( $msg, $code=null, $data=null) | |
Add a warning for this module. More... | |
addDeprecation ( $msg, $feature, $data=[]) | |
Add a deprecation warning for this module. More... | |
addError ( $msg, $code=null, $data=null) | |
Add an error for this module without aborting. More... | |
addMessagesFromStatus (StatusValue $status, $types=[ 'warning', 'error'], array $filter=[]) | |
Add warnings and/or errors from a Status. More... | |
dieWithError ( $msg, $code=null, $data=null, $httpCode=null) | |
Abort execution with an error. More... | |
dieWithException ( $exception, array $options=[]) | |
Abort execution with an error derived from an exception. More... | |
dieBlocked (AbstractBlock $block) | |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info. More... | |
dieStatus (StatusValue $status) | |
Throw an ApiUsageException based on the Status object. More... | |
dieReadOnly () | |
Helper function for readonly errors. More... | |
checkUserRightsAny ( $rights, $user=null) | |
Helper function for permission-denied errors. More... | |
checkTitleUserPermissions (LinkTarget $linkTarget, $actions, $options=[]) | |
Helper function for permission-denied errors. More... | |
dieWithErrorOrDebug ( $msg, $code=null, $data=null, $httpCode=null) | |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true. More... | |
logFeatureUsage ( $feature) | |
Write logging information for API features to a debug log, for usage analysis. More... | |
dieContinueUsageIf ( $condition) | |
Die with the 'badcontinue' error. More... | |
warnOrDie (ApiMessage $msg, $enforceLimits=false) | |
Adds a warning to the output, else dies. More... | |
static | dieDebug ( $method, $message) |
Internal code errors should be reported with this method. More... | |
Help message generation | |
getFinalSummary () | |
Get final module summary. More... | |
getFinalDescription () | |
Get final module description, after hooks have had a chance to tweak it as needed. More... | |
getFinalParams ( $flags=0) | |
Get final list of parameters, after hooks have had a chance to tweak it as needed. More... | |
getFinalParamDescription () | |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed. More... | |
modifyHelp (array &$help, array $options, array &$tocData) | |
Called from ApiHelp before the pieces are joined together and returned. More... | |
getSummaryMessage () | |
Return the summary message. More... | |
getExtendedDescription () | |
Return the extended help text message. More... | |
getHelpFlags () | |
Generates the list of flags for the help screen and for action=paraminfo. More... | |
getModuleSourceInfo () | |
Returns information about the source of this module, if known. More... | |
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 42 of file ApiBase.php.
ApiBase::__construct | ( | ApiMain | $mainModule, |
$moduleName, | |||
$modulePrefix = '' |
|||
) |
ApiMain | $mainModule | |
string | $moduleName | Name of this module |
string | $modulePrefix | Prefix to use for parameter names |
Reimplemented in ApiComparePages, and ApiOpenSearchFormatJson.
Definition at line 303 of file ApiBase.php.
References ContextSource\getContext(), isMain(), and ContextSource\setContext().
ApiBase::addBlockInfoToStatus | ( | StatusValue | $status, |
User | $user = null |
||
) |
Add block info to block messages in a Status.
StatusValue | $status | |
User | null | $user |
Definition at line 1853 of file ApiBase.php.
References $status, ApiMessage\create(), and ContextSource\getUser().
Referenced by dieStatus().
ApiBase::addDeprecation | ( | $msg, | |
$feature, | |||
$data = [] |
|||
) |
Add a deprecation warning for this module.
A combination of $this->addWarning() and $this->logFeatureUsage()
string | array | Message | $msg | See ApiErrorFormatter::addWarning() |
string | null | $feature | See ApiBase::logFeatureUsage() |
array | null | $data | See ApiErrorFormatter::addWarning() |
Definition at line 1947 of file ApiBase.php.
References addWarning(), getMain(), logFeatureUsage(), ContextSource\msg(), and Hooks\run().
Referenced by ApiTokens\execute(), ApiExpandTemplates\execute(), ApiQueryDeletedrevs\execute(), ApiLogin\execute(), getParameterFromSettings(), ApiQueryRevisionsBase\parseParameters(), ApiMain\setupExternalResponse(), and validateTimestamp().
ApiBase::addError | ( | $msg, | |
$code = null , |
|||
$data = null |
|||
) |
Add an error for this module without aborting.
If $msg is not an ApiMessage, the message code will be derived from the message key by stripping any "apiwarn-" or "apierror-" prefix.
string | array | Message | $msg | See ApiErrorFormatter::addError() |
string | null | $code | See ApiErrorFormatter::addError() |
array | null | $data | See ApiErrorFormatter::addError() |
Definition at line 1980 of file ApiBase.php.
References getErrorFormatter(), and getModulePath().
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 1993 of file ApiBase.php.
References $filter, getErrorFormatter(), and getModulePath().
Referenced by ApiDelete\execute().
ApiBase::addWarning | ( | $msg, | |
$code = null , |
|||
$data = null |
|||
) |
Add a warning for this module.
Users should monitor this section to notice any changes in API. Multiple calls to this function will result in multiple warning messages.
If $msg is not an ApiMessage, the message code will be derived from the message key by stripping any "apiwarn-" or "apierror-" prefix.
string | array | Message | $msg | See ApiErrorFormatter::addWarning() |
string | null | $code | See ApiErrorFormatter::addWarning() |
array | null | $data | See ApiErrorFormatter::addWarning() |
Definition at line 1933 of file ApiBase.php.
References getErrorFormatter(), and getModulePath().
Referenced by addDeprecation(), dieWithErrorOrDebug(), ApiTokens\execute(), ApiCheckToken\execute(), ApiPurge\execute(), ApiExpandTemplates\execute(), ApiQueryTokens\execute(), ApiParamInfo\execute(), ApiQueryDisabled\execute(), ApiOptions\execute(), ApiParse\execute(), ApiComparePages\execute(), ApiQueryLanguageinfo\execute(), ApiQueryUsers\execute(), ApiPageSet\executeInternal(), ApiQueryRevisionsBase\extractDeprecatedContent(), ApiQueryInfo\extractPageInfo(), extractRequestParams(), ApiQueryRecentChanges\extractRowInfo(), ApiComparePages\getDiffRevision(), ApiMain\getVal(), ApiMain\handleException(), handleParamNormalization(), ApiQueryImageInfo\mergeThumbParams(), parseMultiValue(), ApiQueryRevisionsBase\parseParameters(), ApiMain\printResult(), ApiMain\reportUnusedParams(), ApiQueryAllDeletedRevisions\run(), ApiQueryImages\run(), ApiQueryCategories\run(), ApiQueryLinks\run(), ApiQueryRevisions\run(), and warnOrDie().
ApiBase::checkTitleUserPermissions | ( | LinkTarget | $linkTarget, |
$actions, | |||
$options = [] |
|||
) |
Helper function for permission-denied errors.
LinkTarget | $linkTarget | |
string | string[] | $actions | |
array | $options | Additional options |
ApiUsageException | if the user doesn't have all of the rights. |
Definition at line 2156 of file ApiBase.php.
References dieStatus(), errorArrayToStatus(), getPermissionManager(), ContextSource\getUser(), and wfDeprecated().
Referenced by ApiProtect\execute(), ApiImageRotate\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiDelete\execute(), ApiParse\execute(), and ApiSetPageLanguage\execute().
ApiBase::checkUserRightsAny | ( | $rights, | |
$user = null |
|||
) |
Helper function for permission-denied errors.
string | string[] | $rights | |
User | null | $user |
ApiUsageException | if the user doesn't have any of the rights. The error message is based on $rights[0]. |
Definition at line 2130 of file ApiBase.php.
References dieWithError(), getPermissionManager(), ContextSource\getUser(), and ContextSource\msg().
Referenced by ApiWatch\execute(), ApiRevisionDelete\execute(), ApiTag\execute(), ApiSetNotificationTimestamp\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), ApiOptions\execute(), ApiQueryDeletedrevs\execute(), ApiBlock\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH\execute(), ApiSetPageLanguage\execute(), and getWatchlistUser().
ApiBase::dieBlocked | ( | AbstractBlock | $block | ) |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info.
AbstractBlock | $block | The block used to generate the ApiUsageException |
ApiUsageException | always |
Definition at line 2055 of file ApiBase.php.
References dieWithError(), MediaWiki\Block\AbstractBlock\getType(), and MediaWiki\Block\AbstractBlock\isSitewide().
Referenced by ApiUpload\checkPermissions(), ApiUndelete\execute(), ApiRevisionDelete\execute(), ApiTag\execute(), ApiEditPage\execute(), and ApiUserrights\execute().
|
protected |
Die with the 'badcontinue' error.
This call is common enough to make it into the base method.
bool | $condition | Will only die if this value is true |
ApiUsageException |
Definition at line 2208 of file ApiBase.php.
References dieWithError().
Referenced by ApiQueryExternalLinks\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryLangLinks\execute(), ApiQueryPageProps\execute(), ApiQueryBlocks\execute(), ApiQueryIWLinks\execute(), ApiQueryReferences\execute(), ApiQueryFilearchive\execute(), ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\execute(), ApiQueryUserContribs\execute(), ApiQueryImageInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryContributors\execute(), ApiQueryPageImages\execute(), ApiQueryInfo\execute(), ApiQueryUserContribs\prepareQuery(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryProtectedTitles\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryWatchlistRaw\run(), ApiQueryDuplicateFiles\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), and ApiQueryRecentChanges\run().
|
staticprotected |
Internal code errors should be reported with this method.
string | $method | Method or function name |
string | $message | Error message |
MWException | always |
Definition at line 2220 of file ApiBase.php.
Referenced by ApiQueryLinks\__construct(), ApiQueryAllLinks\__construct(), ApiQueryBase\addJoinConds(), ApiQueryBase\addTables(), ApiUpload\execute(), ApiFormatPhp\execute(), ApiQueryAllUsers\execute(), ApiFormatJson\execute(), ApiLogin\execute(), ApiFormatRaw\execute(), ApiFormatFeedWrapper\execute(), getContinuationManager(), ApiOpenSearch\getCustomPrinter(), getErrorFormatter(), getFinalParamDescription(), ApiFormatRaw\getMimeType(), getParameterFromSettings(), getResult(), ApiQueryQueryPage\getSpecialPage(), ApiPageSet\initFromQueryResult(), ApiFormatFeedWrapper\initPrinter(), ApiQuery\instantiateModules(), lacksSameOriginSecurity(), ApiOpenSearch\populateResult(), ApiQueryDeletedRevisions\run(), ApiQueryWatchlist\run(), ApiQueryRevisions\run(), ApiQueryRecentChanges\run(), setContinuationManager(), and ApiQueryGeneratorBase\setGeneratorMode().
ApiBase::dieReadOnly | ( | ) |
Helper function for readonly errors.
ApiUsageException | always |
Definition at line 2114 of file ApiBase.php.
References dieWithError(), and wfReadOnlyReason().
Referenced by ApiMain\checkReadOnly(), and ApiEditPage\execute().
ApiBase::dieStatus | ( | StatusValue | $status | ) |
Throw an ApiUsageException based on the Status object.
StatusValue | $status |
ApiUsageException | always |
Definition at line 2086 of file ApiBase.php.
References $status, addBlockInfoToStatus(), and StatusValue\newGood().
Referenced by ApiUpload\checkPermissions(), checkTitleUserPermissions(), ApiUpload\dieRecoverableError(), ApiUpload\dieStatusWithCode(), ApiProtect\execute(), ApiManageTags\execute(), ApiUndelete\execute(), ApiMergeHistory\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiMove\execute(), ApiUpload\execute(), ApiRevisionDelete\execute(), ApiTag\execute(), ApiChangeAuthenticationData\execute(), ApiPatrol\execute(), ApiEditPage\execute(), ApiDelete\execute(), ApiRollback\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiRemoveAuthenticationData\execute(), ApiSetPageLanguage\execute(), ApiUserrights\execute(), ApiResetPassword\execute(), getParameterFromSettings(), ApiUserrights\getUrUser(), ApiUpload\performStash(), ApiUpload\performUpload(), ApiQuerySearch\run(), ApiQueryRevisions\run(), and ApiWatch\watchTitle().
ApiBase::dieWithError | ( | $msg, | |
$code = null , |
|||
$data = null , |
|||
$httpCode = null |
|||
) |
Abort execution with an error.
If $msg is not an ApiMessage, the message code will be derived from the message key by stripping any "apiwarn-" or "apierror-" prefix.
string | array | Message | $msg | See ApiErrorFormatter::addError() |
string | null | $code | See ApiErrorFormatter::addError() |
array | null | $data | See ApiErrorFormatter::addError() |
int | null | $httpCode | HTTP error code to use |
ApiUsageException | always |
Definition at line 2014 of file ApiBase.php.
References ApiUsageException\newWithMessage().
Referenced by ApiMain\checkAsserts(), ApiMain\checkBotReadOnly(), ApiMain\checkExecutePermissions(), ApiMain\checkMaxLag(), ApiQueryImageInfo\checkParameterNormalise(), ApiUpload\checkPermissions(), checkUserRightsAny(), ApiUpload\checkVerification(), ApiMain\createPrinterByName(), dieBlocked(), dieContinueUsageIf(), dieReadOnly(), dieWithErrorOrDebug(), dieWithException(), ApiCSPReport\error(), ApiValidatePassword\execute(), ApiScribuntoConsole\execute(), ApiCategoryTree\execute(), ApiProtect\execute(), ApiManageTags\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiMergeHistory\execute(), ApiImport\execute(), ApiMove\execute(), ApiWatch\execute(), ApiUpload\execute(), ApiLogout\execute(), ApiExpandTemplates\execute(), ApiQueryExternalLinks\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiDisabled\execute(), ApiQueryMyStashedFiles\execute(), ApiPatrol\execute(), ApiQueryAllMessages\execute(), ApiEditPage\execute(), ApiFormatPhp\execute(), ApiQueryLangLinks\execute(), ApiChangeAuthenticationData\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryTitleBlacklist\execute(), ApiOpenSearchFormatJson\execute(), ApiDelete\execute(), ApiQueryBlocks\execute(), ApiQueryIWLinks\execute(), ApiOptions\execute(), ApiUnblock\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryReferences\execute(), ApiBlock\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH\execute(), ApiParse\execute(), ApiFeedRecentChanges\execute(), ApiQueryImageInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryUserContribs\execute(), ApiStashEdit\execute(), ApiSetPageLanguage\execute(), ApiRemoveAuthenticationData\execute(), ApiComparePages\execute(), ApiFeedContributions\execute(), ApiUserrights\execute(), ApiAMCreateAccount\execute(), ApiFeedWatchlist\execute(), ApiLinkAccount\execute(), ApiClientLogin\execute(), ApiResetPassword\execute(), ApiQueryPageImages\execute(), ApiQueryAllPages\executeGenerator(), ApiQueryAllImages\executeGenerator(), ApiPageSet\executeInternal(), ApiQueryRevisionsBase\extractAllSlotInfo(), ApiUpload\getChunkResult(), ApiUpload\getContextResult(), ApiComparePages\getDiffRevision(), ApiFeedRecentChanges\getFeedObject(), getModuleFromPath(), getParameterFromSettings(), ApiParse\getParsedContent(), ApiRollback\getRbTitle(), ApiRollback\getRbUser(), ApiParse\getSectionContent(), getTitleFromTitleOrPageId(), getTitleOrPageId(), getWatchlistUser(), ApiQueryImageInfo\mergeThumbParams(), ApiQuery\outputGeneralPageInfo(), parseMultiValue(), ApiQueryRevisionsBase\parseParameters(), ApiUpload\performUpload(), ApiQueryBase\prefixedTitlePartToKey(), ApiQueryUserContribs\prepareQuery(), ApiQueryBlocks\prepareUsername(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireOnlyOneParameter(), requirePostedParameters(), ApiQueryDeletedRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryExtLinksUsage\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategories\run(), ApiQuerySearch\run(), ApiQueryAllPages\run(), ApiQueryWatchlist\run(), ApiQueryCategoryMembers\run(), ApiQueryAllImages\run(), ApiQueryQueryPage\run(), ApiQueryRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ApiUpload\selectUploadModule(), ApiMain\setupExternalResponse(), ApiMain\setupModule(), ApiQueryBase\titlePartToKey(), ApiFileRevert\validateParameters(), validateTimestamp(), validateUser(), and warnOrDie().
ApiBase::dieWithErrorOrDebug | ( | $msg, | |
$code = null , |
|||
$data = null , |
|||
$httpCode = null |
|||
) |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true.
Otherwise behaves exactly as self::dieWithError().
string | array | Message | $msg | |
string | null | $code | |
array | null | $data | |
int | null | $httpCode |
ApiUsageException |
Definition at line 2191 of file ApiBase.php.
References addWarning(), dieWithError(), and ContextSource\getConfig().
Referenced by ApiQuery\instantiateModules(), and ApiMain\setupExternalResponse().
ApiBase::dieWithException | ( | $exception, | |
array | $options = [] |
||
) |
Abort execution with an error derived from an exception.
Exception | Throwable | $exception | See ApiErrorFormatter::getMessageFromException() |
array | $options | See ApiErrorFormatter::getMessageFromException() |
ApiUsageException | always |
Definition at line 2026 of file ApiBase.php.
References dieWithError(), and getErrorFormatter().
Referenced by ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiEditPage\execute(), ApiParse\execute(), and ApiComparePages\getDiffRevision().
ApiBase::dynamicParameterDocumentation | ( | ) |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams().
Reimplemented in ApiAMCreateAccount, ApiClientLogin, ApiLinkAccount, and ApiChangeAuthenticationData.
Definition at line 728 of file ApiBase.php.
ApiBase::encodeParamName | ( | $paramName | ) |
This method mangles parameter name based on the prefix supplied to the constructor.
Override this method to change parameter name during runtime
string | string[] | $paramName | Parameter name |
Reimplemented in ApiQueryGeneratorBase.
Definition at line 739 of file ApiBase.php.
Referenced by ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiValidatePassword\execute(), ApiImport\execute(), ApiWatch\execute(), ApiQueryAllMessages\execute(), ApiQueryLangLinks\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryIWLinks\execute(), ApiQueryUserContribs\execute(), ApiQueryLogEvents\execute(), ApiFeedContributions\execute(), ApiAMCreateAccount\execute(), ApiLinkAccount\execute(), ApiClientLogin\execute(), ApiQueryLanguageinfo\execute(), ApiQueryPageImages\execute(), ApiPageSet\executeInternal(), extractRequestParams(), getParameterFromSettings(), handleParamNormalization(), ApiQueryBlocks\prepareUsername(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireOnlyOneParameter(), requirePostedParameters(), and validateLimit().
ApiBase::errorArrayToStatus | ( | array | $errors, |
User | $user = null |
||
) |
Turn an array of message keys or key+param arrays into a Status.
array | $errors | |
User | null | $user |
Definition at line 1825 of file ApiBase.php.
References $status, ApiMessage\create(), ContextSource\getUser(), and StatusValue\newGood().
Referenced by checkTitleUserPermissions(), ApiImageRotate\execute(), ApiPatrol\execute(), ApiRollback\execute(), ApiUnblock\execute(), ApiBlock\execute(), and ApiQueryInfo\extractPageInfo().
|
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 ApiMain, ApiQueryInfo, ApiQuery, ApiPageSet, ApiQueryRecentChanges, ApiQueryBacklinks, ApiQueryUsers, ApiFormatFeedWrapper, ApiFormatRaw, ApiOpenSearch, ApiQueryBacklinksprop, ApiQueryAllLinks, ApiQueryPageImages, ApiLogin, ApiQueryLanguageinfo, TextExtracts\ApiQueryExtracts, ApiQueryRevisionsBase, ApiQueryLinks, ApiFormatJson, ApiQueryAllImages, ApiResetPassword, ApiQueryGadgets, ApiQueryQueryPage, ApiClientLogin, ApiAMCreateAccount, ApiFeedWatchlist, ApiLinkAccount, ApiFeedContributions, ApiUserrights, ApiComparePages, ApiQueryContributors, ApiQueryAllUsers, ApiQueryUserInfo, ApiRemoveAuthenticationData, ApiSetPageLanguage, ApiFeedRecentChanges, ApiQueryImageInfo, ApiQueryLogEvents, ApiQueryUserContribs, ApiStashEdit, ApiParse, ApiQueryFileRepoInfo, MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH, ApiCSPReport, ApiBlock, ApiQueryWatchlist, ApiQueryReferences, ApiQueryDeletedrevs, ApiQueryFilearchive, ApiQueryPagePropNames, ApiOptions, ApiQuerySearch, ApiRollback, ApiUnblock, ApiQueryGadgetCategories, ApiDelete, ApiQueryAuthManagerInfo, ApiQueryBlocks, ApiQueryIWLinks, ApiQueryWatchlistRaw, MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate, ApiQueryTitleBlacklist, ApiChangeAuthenticationData, ApiEditPage, ApiFileRevert, ApiFormatPhp, ApiOpenSearchFormatJson, ApiPatrol, ApiQueryAllMessages, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryPageProps, ApiQueryPagesWithProp, ApiQueryPrefixSearch, ApiSetNotificationTimestamp, ApiDisabled, ApiParamInfo, ApiQueryAllCategories, ApiQueryAllPages, ApiQueryCategoryInfo, ApiQueryDisabled, ApiQueryImages, ApiQueryMyStashedFiles, ApiTag, ApiExpandTemplates, ApiFormatNone, ApiQueryCategories, ApiQueryCategoryMembers, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryProtectedTitles, ApiQueryRandom, ApiQueryStashImageInfo, ApiQueryTags, ApiQueryTokens, ApiRevisionDelete, ApiHelp, ApiLogout, ApiPurge, ApiSpamBlacklist, ApiQueryExtLinksUsage, ApiRsd, ApiUpload, ApiCheckToken, ApiMove, ApiWatch, ApiImport, ApiClearHasMsg, ApiEmailUser, ApiImageRotate, ApiMergeHistory, ApiTokens, ApiManageTags, ApiUndelete, ApiProtect, ApiCategoryTree, ApiScribuntoConsole, ApiValidatePassword, and ApiFancyCaptchaReload.
|
protected |
Split a multi-valued parameter string, like explode()
string | $value | |
int | $limit |
Definition at line 1469 of file ApiBase.php.
Referenced by ApiPageSet\handleParamNormalization(), and parseMultiValue().
ApiBase::extractRequestParams | ( | $options = [] | ) |
Using getAllowedParams(), this function makes an array of the values provided by the user, with key being the name of the variable, and value - validated value from user or default.
limits will not be parsed if $parseLimit is set to false; use this when the max limit is not definitive yet, e.g. when getting revisions.
bool | array | $options | If a boolean, uses that as the value for 'parseLimit'
|
Definition at line 761 of file ApiBase.php.
References addWarning(), encodeParamName(), getFinalParams(), getParameterFromSettings(), PARAM_TEMPLATE_VARS, and wfEscapeWikiText().
Referenced by ApiAuthManagerHelper\__construct(), ApiPageSet\__construct(), ApiValidatePassword\execute(), ApiScribuntoConsole\execute(), ApiCategoryTree\execute(), ApiProtect\execute(), ApiManageTags\execute(), ApiUndelete\execute(), ApiImageRotate\execute(), ApiMergeHistory\execute(), ApiEmailUser\execute(), ApiTokens\execute(), ApiImport\execute(), ApiCheckToken\execute(), ApiMove\execute(), ApiWatch\execute(), ApiSpamBlacklist\execute(), ApiUpload\execute(), ApiHelp\execute(), ApiPurge\execute(), ApiQueryExternalLinks\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiExpandTemplates\execute(), ApiRevisionDelete\execute(), ApiQueryCategoryInfo\execute(), ApiQueryMyStashedFiles\execute(), ApiParamInfo\execute(), ApiTag\execute(), ApiQueryAllMessages\execute(), ApiQueryLangLinks\execute(), ApiQueryPageProps\execute(), ApiEditPage\execute(), ApiQueryTitleBlacklist\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), ApiPatrol\execute(), ApiSetNotificationTimestamp\execute(), ApiFileRevert\execute(), ApiFormatPhp\execute(), ApiQueryGadgetCategories\execute(), ApiQueryIWLinks\execute(), ApiDelete\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiOptions\execute(), ApiRollback\execute(), ApiUnblock\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryPagePropNames\execute(), ApiQueryReferences\execute(), ApiBlock\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH\execute(), ApiQueryFileRepoInfo\execute(), ApiParse\execute(), ApiFeedRecentChanges\execute(), ApiQueryImageInfo\execute(), ApiQueryUserContribs\execute(), ApiQueryLogEvents\execute(), ApiStashEdit\execute(), ApiQueryUserInfo\execute(), ApiRemoveAuthenticationData\execute(), ApiSetPageLanguage\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiComparePages\execute(), ApiFeedContributions\execute(), ApiUserrights\execute(), ApiFeedWatchlist\execute(), ApiLinkAccount\execute(), ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiQueryGadgets\execute(), ApiResetPassword\execute(), ApiFormatJson\execute(), ApiLogin\execute(), ApiQueryPageImages\execute(), ApiOpenSearch\execute(), ApiQueryUsers\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiCategoryTree\getConditionalRequestData(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getFormat(), ApiFormatJson\getMimeType(), getParameter(), ApiComparePages\guessModel(), ApiComparePages\guessTitle(), ApiQuery\isReadMode(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryImages\run(), ApiQueryProtectedTitles\run(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryWatchlistRaw\run(), ApiQueryDuplicateFiles\run(), ApiQueryCategories\run(), ApiQuerySearch\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryCategoryMembers\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryQueryPage\run(), ApiQueryRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), and ApiMain\setupExecuteAction().
|
protected |
Filter out-of-range values from a list of positive integer IDs.
array | $fields | Array of pairs of table and field to check |
(string|int)[] | $ids IDs to filter. Strings in the array are expected to be stringified ints. |
Definition at line 1885 of file ApiBase.php.
References getDB().
Referenced by ApiQueryBase\addWhereIDsFld(), ApiPageSet\initFromPageIds(), and ApiPageSet\initFromRevIDs().
|
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 ApiMain, ApiQueryInfo, ApiHelp, ApiUpload, ApiParse, ApiQueryRecentChanges, ApiQueryImageInfo, ApiQueryRevisionsBase, ApiComparePages, ApiQueryUserContribs, ApiParamInfo, ApiEditPage, ApiQueryBacklinks, ApiQueryRevisions, ApiQueryWatchlist, ApiQueryDeletedrevs, ApiQueryAllDeletedRevisions, ApiQueryBacklinksprop, ApiFormatBase, ApiQueryUsers, TextExtracts\ApiQueryExtracts, ApiQuerySearch, ApiQueryBlocks, ApiQueryAllUsers, ApiQueryAllImages, ApiQueryUserInfo, ApiQueryCategoryMembers, ApiOpenSearch, ApiQueryDeletedRevisions, ApiQueryAllPages, ApiQueryAllRevisions, ApiCSPReport, ApiLogin, ApiQueryFilearchive, ApiQueryAllLinks, ApiMove, ApiQueryPageImages, ApiQueryContributors, ApiFeedContributions, ApiQueryAllMessages, ApiQueryLanguageinfo, ApiOptions, ApiQueryExtLinksUsage, ApiDelete, ApiQueryLinks, ApiExpandTemplates, ApiQueryGadgets, ApiBlock, ApiQueryProtectedTitles, ApiQueryCategories, ApiQueryRandom, ApiTag, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryQueryPage, ApiStashEdit, ApiUserrights, ApiQueryDuplicateFiles, ApiRevisionDelete, ApiQueryAllCategories, ApiQueryIWLinks, ApiQueryExternalLinks, ApiQueryLangLinks, ApiImport, ApiProtect, ApiQueryImages, ApiQueryWatchlistRaw, ApiScribuntoConsole, ApiQueryPagesWithProp, ApiQueryTags, ApiFeedRecentChanges, ApiCategoryTree, ApiFormatJson, ApiQueryMyStashedFiles, ApiClientLogin, ApiAMCreateAccount, ApiLinkAccount, ApiRollback, ApiSetPageLanguage, MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate, ApiUnblock, ApiFileRevert, ApiQueryStashImageInfo, ApiUndelete, ApiMergeHistory, ApiQueryTokens, ApiQueryPrefixSearch, ApiQueryPageProps, ApiQueryAuthManagerInfo, ApiQueryCategoryInfo, ApiResetPassword, ApiTokens, ApiRemoveAuthenticationData, ApiPatrol, ApiEmailUser, ApiManageTags, ApiQueryPagePropNames, MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH, ApiQueryGadgetCategories, ApiQueryTitleBlacklist, ApiChangeAuthenticationData, ApiFormatPhp, ApiQueryFileRepoInfo, ApiCheckToken, ApiValidatePassword, ApiSpamBlacklist, ApiQueryDisabled, ApiQueryReferences, and ApiFancyCaptchaReload.
Definition at line 394 of file ApiBase.php.
Referenced by getFinalParams().
ApiBase::getConditionalRequestData | ( | $condition | ) |
Returns data for HTTP conditional request mechanisms.
string | $condition | Condition being queried:
|
Reimplemented in ApiCategoryTree.
Definition at line 505 of file ApiBase.php.
ApiBase::getContinuationManager | ( | ) |
Get the continuation manager.
Reimplemented in ApiMain.
Definition at line 680 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiQueryAllRevisions\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryGeneratorBase\setContinueEnumParameter(), and ApiQueryBase\setContinueEnumParameter().
ApiBase::getCustomPrinter | ( | ) |
If the module may only be used with a certain format module, it should override this method to return an instance of that formatter.
A value of null means the default format will be used.
Reimplemented in ApiHelp, ApiQuery, ApiOpenSearch, ApiRsd, ApiFeedContributions, ApiFeedWatchlist, and ApiFeedRecentChanges.
Definition at line 354 of file ApiBase.php.
|
protected |
Gets a default replica DB connection object.
Reimplemented in ApiPageSet, ApiQueryBase, and ApiQueryAllImages.
Definition at line 668 of file ApiBase.php.
References $mReplicaDB, DB_REPLICA, and wfGetDB().
Referenced by ApiQuery\doExport(), filterIDs(), ApiParse\formatCategoryLinks(), ApiComparePages\getRevisionById(), and ApiOpenSearch\search().
ApiBase::getErrorFormatter | ( | ) |
Get the error formatter.
Reimplemented in ApiMain.
Definition at line 654 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), dieWithException(), ApiValidatePassword\execute(), ApiManageTags\execute(), ApiEmailUser\execute(), ApiImageRotate\execute(), ApiMove\execute(), ApiLogout\execute(), ApiFileRevert\execute(), ApiLogin\execute(), ApiQueryUsers\execute(), ApiQueryInfo\extractPageInfo(), ApiRevisionDelete\extractStatusInfo(), ApiLogin\formatMessage(), ApiUpload\handleStashException(), ApiMove\moveSubpages(), ApiUpload\performStash(), ApiTag\processIndividual(), ApiPageSet\processTitlesArray(), and ApiWatch\watchTitle().
|
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 ApiMain, ApiQueryInfo, ApiUpload, ApiParse, ApiHelp, ApiQueryImageInfo, ApiQueryRecentChanges, ApiComparePages, ApiQueryUserContribs, ApiEditPage, ApiParamInfo, ApiQueryBacklinks, ApiQuery, ApiQueryRevisions, ApiQueryWatchlist, ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryAllDeletedRevisions, ApiQueryBacklinksprop, ApiQuerySearch, ApiQueryAllImages, ApiQueryBlocks, ApiQueryUsers, ApiQueryAllUsers, TextExtracts\ApiQueryExtracts, ApiQueryCategoryMembers, ApiFormatBase, ApiQueryUserInfo, ApiQueryAllPages, ApiOpenSearch, ApiQueryAllRevisions, ApiFeedWatchlist, ApiQueryDeletedRevisions, ApiQueryFilearchive, ApiQueryAllLinks, ApiMove, ApiLogin, ApiQueryExtLinksUsage, ApiQueryPageImages, ApiQueryContributors, ApiFeedContributions, ApiQueryAllMessages, ApiSetNotificationTimestamp, ApiQueryProtectedTitles, ApiBlock, ApiOptions, ApiDelete, ApiQueryLanguageinfo, ApiExpandTemplates, ApiQueryCategories, ApiQueryLinks, ApiQueryGadgets, ApiTag, ApiUserrights, ApiQueryRandom, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiImageRotate, ApiRollback, ApiQueryAllCategories, ApiQueryQueryPage, ApiQueryWatchlistRaw, ApiRevisionDelete, ApiQueryIWLinks, ApiProtect, ApiQueryLangLinks, ApiQueryDuplicateFiles, ApiFeedRecentChanges, ApiImport, ApiQueryExternalLinks, ApiWatch, ApiQueryImages, ApiQueryPagesWithProp, ApiQueryTags, ApiPurge, ApiQueryStashImageInfo, ApiQueryMyStashedFiles, ApiUndelete, ApiSetPageLanguage, ApiUnblock, ApiAMCreateAccount, ApiFileRevert, ApiClientLogin, ApiMergeHistory, MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate, ApiResetPassword, ApiQueryPrefixSearch, ApiLinkAccount, ApiQueryAuthManagerInfo, ApiManageTags, ApiQueryTokens, ApiQueryPageProps, ApiQueryReferences, ApiQueryFileRepoInfo, ApiPatrol, ApiQueryCategoryInfo, ApiEmailUser, ApiTokens, ApiQueryGadgetCategories, ApiQueryPagePropNames, ApiQueryTitleBlacklist, ApiRemoveAuthenticationData, MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH, ApiChangeAuthenticationData, ApiCheckToken, ApiLogout, ApiValidatePassword, ApiSpamBlacklist, ApiRsd, ApiClearHasMsg, and ApiFancyCaptchaReload.
Definition at line 369 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 ApiDisabled, ApiQueryDisabled, ApiResetPassword, ApiLogin, and ApiSetPageLanguage.
Definition at line 2289 of file ApiBase.php.
Referenced by getFinalDescription().
ApiBase::getFinalDescription | ( | ) |
Get final module description, after hooks have had a chance to tweak it as needed.
Reimplemented in ApiClientLogin, ApiAMCreateAccount, and ApiLinkAccount.
Definition at line 2318 of file ApiBase.php.
References ContextSource\getContext(), getExtendedDescription(), getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), makeMessage(), and Hooks\run().
ApiBase::getFinalParamDescription | ( | ) |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed.
Definition at line 2379 of file ApiBase.php.
References $path, dieDebug(), ContextSource\getContext(), getFinalParams(), getModuleFromPath(), getModuleManager(), getModuleName(), getModulePath(), getModulePrefix(), isMain(), makeMessage(), ContextSource\msg(), PARAM_DEPRECATED_VALUES, PARAM_HELP_MSG, PARAM_HELP_MSG_PER_VALUE, PARAM_SUBMODULE_MAP, and Hooks\run().
ApiBase::getFinalParams | ( | $flags = 0 | ) |
Get final list of parameters, after hooks have had a chance to tweak it as needed.
int | $flags | Zero or more flags like GET_VALUES_FOR_HELP |
Definition at line 2347 of file ApiBase.php.
References getAllowedParams(), needsToken(), and Hooks\run().
Referenced by extractRequestParams(), and getFinalParamDescription().
ApiBase::getFinalSummary | ( | ) |
Get final module summary.
Definition at line 2302 of file ApiBase.php.
References ContextSource\getContext(), getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), and makeMessage().
|
protected |
Generates the list of flags for the help screen and for action=paraminfo.
Corresponding messages: api-help-flag-deprecated, api-help-flag-internal, api-help-flag-readrights, api-help-flag-writerights, api-help-flag-mustbeposted
Reimplemented in ApiQueryGeneratorBase.
Definition at line 2516 of file ApiBase.php.
References isDeprecated(), isInternal(), isReadMode(), isWriteMode(), and mustBePosted().
ApiBase::getHelpUrls | ( | ) |
Return links to more detailed help pages about the module.
Reimplemented in ApiQueryInfo, ApiUpload, ApiHelp, ApiParse, ApiQueryImageInfo, ApiQueryRecentChanges, ApiQueryUserContribs, ApiEditPage, ApiParamInfo, ApiQueryBacklinks, ApiQuery, ApiQueryRevisions, ApiQueryWatchlist, ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryAllDeletedRevisions, ApiQueryBacklinksprop, ApiQuerySearch, ApiQueryAllImages, ApiQueryBlocks, ApiQueryUsers, ApiQueryAllUsers, TextExtracts\ApiQueryExtracts, ApiQueryCategoryMembers, ApiFormatBase, ApiQueryUserInfo, ApiQueryAllPages, ApiOpenSearch, ApiQueryAllRevisions, ApiFeedWatchlist, ApiQueryAllLinks, ApiQueryDeletedRevisions, ApiQueryFilearchive, ApiMove, ApiQueryPageImages, ApiLogin, ApiQueryExtLinksUsage, ApiQueryContributors, ApiQueryAllMessages, ApiSetNotificationTimestamp, ApiQueryProtectedTitles, ApiBlock, ApiDelete, ApiQueryLinks, ApiQueryCategories, ApiExpandTemplates, ApiOptions, ApiUserrights, ApiTag, ApiQueryRandom, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiRollback, ApiRevisionDelete, ApiQueryAllCategories, ApiProtect, ApiQueryWatchlistRaw, ApiQueryQueryPage, ApiQueryIWLinks, ApiQueryLangLinks, ApiQueryDuplicateFiles, ApiWatch, ApiImport, ApiQueryExternalLinks, ApiQueryImages, ApiQueryPagesWithProp, ApiQueryTags, ApiPurge, ApiQueryStashImageInfo, ApiUndelete, ApiQueryMyStashedFiles, ApiSetPageLanguage, ApiUnblock, ApiResetPassword, ApiMergeHistory, ApiAMCreateAccount, ApiClientLogin, ApiQueryTokens, ApiQueryAuthManagerInfo, ApiManageTags, ApiQueryPrefixSearch, ApiLinkAccount, ApiQueryFileRepoInfo, ApiQueryPageProps, ApiPatrol, ApiQueryCategoryInfo, ApiEmailUser, ApiRemoveAuthenticationData, ApiQueryPagePropNames, ApiChangeAuthenticationData, ApiLogout, ApiValidatePassword, ApiSpamBlacklist, and ApiClearHasMsg.
Definition at line 378 of file ApiBase.php.
ApiBase::getMain | ( | ) |
Get the main module.
Definition at line 536 of file ApiBase.php.
References $mMainModule.
Referenced by ApiFormatJson\__construct(), ApiFormatBase\__construct(), ApiQueryBase\__construct(), ApiContinuationManager\__construct(), ApiPageSet\__construct(), addDeprecation(), ApiFormatBase\closePrinter(), ApiCategoryTree\execute(), ApiUpload\execute(), ApiHelp\execute(), ApiExpandTemplates\execute(), ApiParamInfo\execute(), ApiEditPage\execute(), ApiQueryGadgetCategories\execute(), ApiQueryDeletedrevs\execute(), ApiParse\execute(), ApiFeedRecentChanges\execute(), ApiComparePages\execute(), ApiFeedWatchlist\execute(), ApiQueryGadgets\execute(), ApiOpenSearch\execute(), ApiQuery\execute(), ApiPageSet\executeInternal(), ApiQueryInfo\extractPageInfo(), ApiParamInfo\getAllowedParams(), ApiUpload\getChunkResult(), getContinuationManager(), ApiQueryUserInfo\getCurrentUserInfo(), ApiFeedRecentChanges\getCustomPrinter(), ApiFeedWatchlist\getCustomPrinter(), ApiFeedContributions\getCustomPrinter(), ApiRsd\getCustomPrinter(), ApiOpenSearch\getCustomPrinter(), ApiQuery\getCustomPrinter(), ApiHelp\getCustomPrinter(), getErrorFormatter(), ApiPageSet\getGenerators(), getModuleFromPath(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), getParent(), getResult(), ApiFeedWatchlist\getWatchlistModule(), ApiFormatRaw\initPrinter(), ApiFormatBase\initPrinter(), lacksSameOriginSecurity(), logFeatureUsage(), ApiQueryRevisionsBase\parseParameters(), requirePostedParameters(), ApiQuerySearch\run(), ApiQueryRandom\run(), ApiUpload\selectUploadModule(), setContinuationManager(), ApiFormatBase\setHttpStatus(), ApiComparePages\setVals(), and validateLimit().
ApiBase::getModuleFromPath | ( | $path | ) |
Get a module from its module path.
string | $path |
ApiUsageException |
Definition at line 602 of file ApiBase.php.
References $path, dieWithError(), getMain(), and wfEscapeWikiText().
Referenced by ApiHelp\execute(), ApiParamInfo\execute(), getFinalParamDescription(), and ApiParamInfo\getModuleInfo().
ApiBase::getModuleManager | ( | ) |
Get the module manager, or null if this module has no sub-modules.
Reimplemented in ApiMain, and ApiQuery.
Definition at line 341 of file ApiBase.php.
Referenced by ApiParamInfo\execute(), getFinalParamDescription(), getParameterFromSettings(), and ApiParamInfo\listAllSubmodules().
ApiBase::getModuleName | ( | ) |
Get the name of the module being executed by this instance.
Definition at line 520 of file ApiBase.php.
References $mModuleName.
Referenced by ApiPageSet\__construct(), ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiQuerySearch\addInterwikiResults(), ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryGadgets\applyList(), ApiFancyCaptchaReload\execute(), ApiValidatePassword\execute(), ApiCategoryTree\execute(), ApiProtect\execute(), ApiManageTags\execute(), ApiUndelete\execute(), ApiClearHasMsg\execute(), ApiMergeHistory\execute(), ApiTokens\execute(), ApiImageRotate\execute(), ApiEmailUser\execute(), ApiImport\execute(), ApiMove\execute(), ApiCheckToken\execute(), ApiWatch\execute(), ApiUpload\execute(), ApiPurge\execute(), ApiHelp\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiRevisionDelete\execute(), ApiExpandTemplates\execute(), ApiQueryDisabled\execute(), ApiQueryMyStashedFiles\execute(), ApiParamInfo\execute(), ApiTag\execute(), ApiDisabled\execute(), ApiQueryAllMessages\execute(), ApiPatrol\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), ApiSetNotificationTimestamp\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiQueryAuthManagerInfo\execute(), ApiDelete\execute(), ApiQueryBlocks\execute(), ApiOptions\execute(), ApiRollback\execute(), ApiUnblock\execute(), ApiQueryFilearchive\execute(), ApiQueryPagePropNames\execute(), ApiQueryDeletedrevs\execute(), ApiBlock\execute(), ApiCSPReport\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH\execute(), ApiParse\execute(), ApiQueryLogEvents\execute(), ApiQueryUserContribs\execute(), ApiStashEdit\execute(), ApiSetPageLanguage\execute(), ApiQueryUserInfo\execute(), ApiRemoveAuthenticationData\execute(), ApiQueryAllUsers\execute(), ApiComparePages\execute(), ApiUserrights\execute(), ApiQueryLanguageinfo\execute(), ApiQueryUsers\execute(), ApiQueryBacklinksprop\getAllowedParams(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiQueryLanguageinfo\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiFormatBase\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiLinkAccount\getFinalDescription(), ApiAMCreateAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiQueryAllLinks\getHelpUrls(), ApiQueryBacklinksprop\getHelpUrls(), ApiQueryGadgetCategories\getList(), getModulePath(), getParameterFromSettings(), ApiAuthManagerHelper\logAuthenticationResult(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryProtectedTitles\run(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllCategories\run(), ApiQuerySearch\run(), ApiQueryPagesWithProp\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryWatchlist\run(), ApiQueryAllImages\run(), ApiQueryQueryPage\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), and ApiUpload\selectUploadModule().
ApiBase::getModulePath | ( | ) |
Get the path to this module.
Definition at line 584 of file ApiBase.php.
References getModuleName(), getParent(), and isMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiQueryLanguageinfo\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), and ApiHelp\getHelp().
ApiBase::getModulePrefix | ( | ) |
Get parameter prefix (usually two letters or an empty string).
Definition at line 528 of file ApiBase.php.
References $mModulePrefix.
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryStashImageInfo\execute(), ApiQueryImageInfo\execute(), ApiQueryUserInfo\getAllowedParams(), ApiQueryLanguageinfo\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllDeletedRevisions\run(), ApiQueryProtectedTitles\run(), ApiQueryPrefixSearch\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), and ApiQueryAllLinks\run().
|
protected |
Returns information about the source of this module, if known.
Returned array is an array with the following keys:
Definition at line 2549 of file ApiBase.php.
References $ext, $IP, $mModuleSource, $path, ContextSource\getConfig(), and ExtensionRegistry\getInstance().
|
protected |
Get a value for the given parameter.
string | $paramName | Parameter name |
bool | $parseLimit | See extractRequestParams() |
Definition at line 876 of file ApiBase.php.
References extractRequestParams().
Referenced by ApiFormatRaw\__construct(), ApiMain\addRequestedFields(), ApiCSPReport\execute(), ApiFeedRecentChanges\execute(), ApiQueryLanguageinfo\execute(), ApiOpenSearch\getCustomPrinter(), ApiQuery\getCustomPrinter(), ApiCSPReport\getFlags(), ApiMain\handleCORS(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryRevisions\run(), ApiMain\sendCacheHeaders(), and ApiMain\setCacheMode().
|
protected |
Using the settings determine the value for the given parameter.
string | $paramName | Parameter name |
array | mixed | $paramSettings | Default value or an array of settings using PARAM_* constants. |
bool | $parseLimit | Whether to parse and validate 'limit' parameters |
Reimplemented in ApiFormatBase.
Definition at line 1140 of file ApiBase.php.
References $type, addDeprecation(), ALL_DEFAULT_STRING, ChangeTags\canAddTagsAccompanyingChange(), dieDebug(), dieStatus(), dieWithError(), encodeParamName(), getMain(), getModuleManager(), getModuleName(), getResult(), handleParamNormalization(), PARAM_ALL, PARAM_ALLOW_DUPLICATES, PARAM_DEPRECATED, PARAM_DEPRECATED_VALUES, PARAM_DFLT, PARAM_ISMULTI, PARAM_ISMULTI_LIMIT1, PARAM_ISMULTI_LIMIT2, PARAM_MAX, PARAM_MAX2, PARAM_MIN, PARAM_RANGE_ENFORCE, PARAM_REQUIRED, PARAM_TYPE, parseMultiValue(), validateLimit(), validateTimestamp(), and validateUser().
Referenced by extractRequestParams().
ApiBase::getParent | ( | ) |
Get the parent of this module.
Reimplemented in ApiQueryBase.
Definition at line 554 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 710 of file ApiBase.php.
Referenced by ApiMain\canApiHighLimits(), ApiMain\checkAsserts(), ApiMain\checkExecutePermissions(), checkTitleUserPermissions(), checkUserRightsAny(), ApiQuery\doExport(), ApiManageTags\execute(), ApiUndelete\execute(), ApiImport\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiQueryBlocks\execute(), ApiUnblock\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiBlock\execute(), ApiQueryLogEvents\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiUserrights\execute(), ApiQueryUsers\execute(), ApiQueryInfo\extractPageInfo(), ApiFeedContributions\feedItem(), ApiQueryContributors\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryInfo\getBlockToken(), ApiQueryUserInfo\getCurrentUserInfo(), ApiQueryInfo\getDeleteToken(), ApiQueryInfo\getEditToken(), ApiQueryInfo\getImportToken(), ApiQueryInfo\getMoveToken(), ApiQueryInfo\getProtectToken(), ApiComparePages\getRevisionById(), ApiQueryRevisions\getRollbackToken(), ApiQueryInfo\getVisitingWatcherInfo(), ApiQueryInfo\getWatchedInfo(), ApiQueryInfo\getWatcherInfo(), ApiPageSet\initFromRevIDs(), ApiMain\modifyHelp(), ApiMove\movePage(), ApiQueryUserContribs\prepareQuery(), ApiTag\processIndividual(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryRecentChanges\run(), and ApiQueryBase\userCanSeeRevDel().
ApiBase::getResult | ( | ) |
Get the result object.
Reimplemented in ApiMain.
Definition at line 640 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryGadgets\applyList(), ApiFormatRaw\closePrinter(), ApiFormatBase\closePrinter(), ApiFancyCaptchaReload\execute(), ApiValidatePassword\execute(), ApiScribuntoConsole\execute(), ApiCategoryTree\execute(), ApiProtect\execute(), ApiManageTags\execute(), ApiUndelete\execute(), ApiClearHasMsg\execute(), ApiImageRotate\execute(), ApiEmailUser\execute(), ApiMergeHistory\execute(), ApiTokens\execute(), ApiImport\execute(), ApiCheckToken\execute(), ApiMove\execute(), ApiWatch\execute(), ApiSpamBlacklist\execute(), ApiRsd\execute(), ApiUpload\execute(), ApiHelp\execute(), ApiPurge\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiRevisionDelete\execute(), ApiExpandTemplates\execute(), ApiQueryMyStashedFiles\execute(), ApiTag\execute(), ApiParamInfo\execute(), ApiFileRevert\execute(), ApiFormatPhp\execute(), ApiQueryPageProps\execute(), ApiEditPage\execute(), ApiQueryTitleBlacklist\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), ApiOpenSearchFormatJson\execute(), ApiPatrol\execute(), ApiSetNotificationTimestamp\execute(), ApiChangeAuthenticationData\execute(), ApiQueryAllMessages\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiDelete\execute(), ApiUnblock\execute(), ApiOptions\execute(), ApiRollback\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryPagePropNames\execute(), ApiBlock\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH\execute(), ApiCSPReport\execute(), ApiQueryFileRepoInfo\execute(), ApiParse\execute(), ApiQueryImageInfo\execute(), ApiQueryLogEvents\execute(), ApiFeedRecentChanges\execute(), ApiQueryUserContribs\execute(), ApiStashEdit\execute(), ApiQueryUserInfo\execute(), ApiSetPageLanguage\execute(), ApiRemoveAuthenticationData\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiComparePages\execute(), ApiFeedContributions\execute(), ApiUserrights\execute(), ApiFeedWatchlist\execute(), ApiLinkAccount\execute(), ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiResetPassword\execute(), ApiFormatJson\execute(), ApiQueryLanguageinfo\execute(), ApiLogin\execute(), ApiFormatRaw\execute(), ApiFormatFeedWrapper\execute(), ApiQueryUsers\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiFormatRaw\getFilename(), ApiQueryGadgetCategories\getList(), ApiFormatRaw\getMimeType(), getParameterFromSettings(), ApiFormatRaw\initPrinter(), ApiFormatFeedWrapper\initPrinter(), ApiQuery\outputGeneralPageInfo(), ApiQueryRevisionsBase\parseParameters(), ApiOpenSearch\populateResult(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryProtectedTitles\run(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryWatchlistRaw\run(), ApiQuerySearch\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryCategoryMembers\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryQueryPage\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), ApiUpload\selectUploadModule(), ApiQueryGadgets\setIndexedTagNameForMetadata(), and ApiQueryPageImages\setResultValues().
|
protected |
Return the summary message.
This is a one-line description of the module, suitable for display in a list of modules.
Reimplemented in ApiDisabled, and ApiQueryDisabled.
Definition at line 2276 of file ApiBase.php.
Referenced by getFinalDescription(), and getFinalSummary().
ApiBase::getTitleFromTitleOrPageId | ( | $params | ) |
Get a Title object from a title or pageid param, if possible.
Can die, if no param is set or if the title or page id is not valid.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
Definition at line 1071 of file ApiBase.php.
References dieWithError(), Title\newFromID(), Title\newFromText(), requireOnlyOneParameter(), and wfEscapeWikiText().
ApiBase::getTitleOrPageId | ( | $params, | |
$load = false |
|||
) |
Get a WikiPage object from a title or pageid param, if possible.
Can die, if no param is set or if the title or page id is not valid.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
bool | string | $load | Whether load the object's state from the database:
|
Definition at line 1034 of file ApiBase.php.
References dieWithError(), WikiPage\factory(), WikiPage\newFromID(), Title\newFromText(), requireOnlyOneParameter(), and wfEscapeWikiText().
Referenced by ApiProtect\execute(), ApiEditPage\execute(), ApiDelete\execute(), ApiParse\execute(), ApiStashEdit\execute(), ApiSetPageLanguage\execute(), and ApiQueryCategoryMembers\run().
ApiBase::getWatchlistUser | ( | $params | ) |
Gets the user for whom to get the watchlist.
array | $params |
Definition at line 1765 of file ApiBase.php.
References checkUserRightsAny(), dieWithError(), ContextSource\getUser(), User\newFromName(), and wfEscapeWikiText().
Referenced by ApiQueryWatchlistRaw\run(), and ApiQueryWatchlist\run().
|
protected |
Return true if we're to watch the page, false if not, null if no change.
string | $watchlist | Valid values: 'watch', 'unwatch', 'preferences', 'nochange' |
Title | $titleObj | The page under consideration |
string | null | $userOption | The user option to consider when $watchlist=preferences. If not set will use watchdefault always and watchcreations if $titleObj doesn't exist. |
Definition at line 1099 of file ApiBase.php.
References ContextSource\getUser(), and User\IGNORE_USER_RIGHTS.
Referenced by ApiEditPage\execute(), ApiUpload\performUpload(), and setWatch().
|
protected |
Fetch the salt used in the Web UI corresponding to this module.
Only override this if the Web UI uses a token with a non-constant salt.
array | $params | All supplied parameters for the module |
Reimplemented in ApiUserrights, and ApiLogout.
Definition at line 489 of file ApiBase.php.
Referenced by validateToken().
|
protected |
Handle when a parameter was Unicode-normalized.
string | $paramName | Unprefixed parameter name |
string | $value | Input that will be used. |
string | $rawValue | Input before normalization. |
Reimplemented in ApiPageSet.
Definition at line 1457 of file ApiBase.php.
References addWarning(), and encodeParamName().
Referenced by getParameterFromSettings().
ApiBase::isDeprecated | ( | ) |
Indicates whether this module is deprecated.
Reimplemented in ApiQueryDeletedrevs, ApiLogin, and ApiTokens.
Definition at line 444 of file ApiBase.php.
Referenced by getHelpFlags().
ApiBase::isInternal | ( | ) |
Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party use and may be unstable.
Reimplemented in ApiCSPReport, ApiStashEdit, ApiCategoryTree, ApiScribuntoConsole, MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate, and MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH.
Definition at line 454 of file ApiBase.php.
Referenced by getHelpFlags().
ApiBase::isMain | ( | ) |
Returns true if this module is the main module ($this === $this->mMainModule), false otherwise.
Definition at line 545 of file ApiBase.php.
References $mMainModule.
Referenced by __construct(), getContinuationManager(), getErrorFormatter(), getFinalParamDescription(), getModulePath(), getParent(), getResult(), lacksSameOriginSecurity(), and setContinuationManager().
ApiBase::isReadMode | ( | ) |
Indicates whether this module requires read rights.
Reimplemented in ApiMain, ApiHelp, ApiParamInfo, ApiQuery, ApiCSPReport, ApiLogin, ApiQueryTokens, ApiClientLogin, ApiAMCreateAccount, ApiLinkAccount, ApiQueryAuthManagerInfo, ApiLogout, ApiRsd, and ApiDisabled.
Definition at line 412 of file ApiBase.php.
Referenced by getHelpFlags().
ApiBase::isWriteMode | ( | ) |
Indicates whether this module requires write mode.
This should return true for modules that may require synchronous database writes. Modules that do not need such writes should also not rely on master database access, since only read queries are needed and each master DB is a single point of failure. Additionally, requests that only need replica DBs can be efficiently routed to any datacenter via the Promise-Non-Write-API-Action header.
Reimplemented in ApiUpload, ApiEditPage, ApiCSPReport, ApiMove, ApiStashEdit, ApiSetNotificationTimestamp, ApiOptions, ApiDelete, ApiBlock, ApiTag, ApiImageRotate, ApiUserrights, ApiRevisionDelete, ApiWatch, ApiImport, ApiProtect, ApiPurge, ApiAMCreateAccount, ApiRollback, ApiSetPageLanguage, ApiUnblock, ApiFileRevert, ApiLinkAccount, ApiUndelete, ApiMergeHistory, ApiRemoveAuthenticationData, ApiResetPassword, ApiPatrol, ApiEmailUser, ApiManageTags, ApiChangeAuthenticationData, and ApiClearHasMsg.
Definition at line 427 of file ApiBase.php.
Referenced by getHelpFlags(), and ApiMain\setRequestExpectations().
ApiBase::lacksSameOriginSecurity | ( | ) |
Returns true if the current request breaks the same-origin policy.
For example, json with callbacks.
https://en.wikipedia.org/wiki/Same-origin_policy
Reimplemented in ApiMain.
Definition at line 568 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiQueryTokens\execute(), ApiQueryDeletedrevs\execute(), ApiLogin\execute(), ApiQueryUserInfo\getCurrentUserInfo(), ApiQueryRevisions\getTokenFunctions(), ApiQueryRecentChanges\getTokenFunctions(), ApiQueryUsers\getTokenFunctions(), ApiQueryInfo\getTokenFunctions(), and ApiTokens\getTokenTypes().
ApiBase::logFeatureUsage | ( | $feature | ) |
Write logging information for API features to a debug log, for usage analysis.
string | $feature | Feature being used. |
Definition at line 2230 of file ApiBase.php.
References $s, getMain(), ContextSource\getRequest(), ContextSource\getUser(), wfDebugLog(), and wfUrlencode().
Referenced by addDeprecation().
|
static |
Create a Message from a string or array.
A string is used as a message key. An array has the message key as the first value and message parameters as subsequent values.
string | array | Message | $msg | |
IContextSource | $context | |
array | null | $params |
Definition at line 1800 of file ApiBase.php.
References ContextSource\$context, and wfMessage().
Referenced by ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
ApiBase::modifyHelp | ( | array & | $help, |
array | $options, | ||
array & | $tocData | ||
) |
Called from ApiHelp before the pieces are joined together and returned.
This exists mainly for ApiMain to add the Permissions and Credits sections. Other modules probably don't need it.
string[] | &$help | Array of help data |
array | $options | Options passed to ApiHelp::getHelp |
array | &$tocData | If a TOC is being generated, this array has keys as anchors in the page and values as for Linker::generateTOC(). |
Reimplemented in ApiMain.
Definition at line 2638 of file ApiBase.php.
ApiBase::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Reimplemented in ApiUpload, ApiEditPage, ApiCSPReport, ApiLogin, ApiMove, ApiStashEdit, ApiSetNotificationTimestamp, ApiOptions, ApiDelete, ApiBlock, ApiTag, ApiImageRotate, ApiUserrights, ApiRevisionDelete, ApiWatch, ApiImport, ApiProtect, ApiPurge, ApiRollback, ApiSetPageLanguage, ApiUnblock, ApiFileRevert, ApiUndelete, ApiMergeHistory, ApiPatrol, ApiEmailUser, ApiManageTags, ApiLogout, ApiValidatePassword, and ApiClearHasMsg.
Definition at line 435 of file ApiBase.php.
References needsToken().
Referenced by getHelpFlags().
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 ApiUpload, ApiEditPage, ApiMove, ApiBlock, ApiDelete, ApiOptions, ApiTag, ApiSetNotificationTimestamp, ApiStashEdit, ApiUserrights, ApiImageRotate, ApiRevisionDelete, ApiProtect, ApiImport, ApiWatch, ApiRollback, ApiUndelete, ApiSetPageLanguage, ApiUnblock, ApiFileRevert, ApiMergeHistory, ApiClientLogin, ApiManageTags, ApiAMCreateAccount, ApiLinkAccount, MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate, ApiPatrol, ApiEmailUser, ApiRemoveAuthenticationData, ApiResetPassword, ApiChangeAuthenticationData, and ApiLogout.
Definition at line 476 of file ApiBase.php.
Referenced by getFinalParams(), mustBePosted(), and validateToken().
|
private |
Callback function used in requireOnlyOneParameter to check whether required parameters are set.
object | $x | Parameter to check is not null/false |
Definition at line 1019 of file ApiBase.php.
|
protected |
Return an array of values that were given in a 'a|b|c' notation, after it optionally validates them against the list allowed values.
string | $valueName | The name of the parameter (for error reporting) |
mixed | $value | The value being parsed |
bool | $allowMultiple | Can $value contain more than one value separated by '|'? |
string[] | null | $allowedValues | An array of values to check against. If null, all values are accepted. |
string | null | $allSpecifier | String to use to specify all allowed values, or null if this behavior should not be allowed |
int | null | $limit1 | Maximum number of values, for normal users. |
int | null | $limit2 | Maximum number of values, for users with the apihighlimits right. |
Definition at line 1497 of file ApiBase.php.
References addWarning(), dieWithError(), explodeMultiValue(), LIMIT_SML1, LIMIT_SML2, and wfEscapeWikiText().
Referenced by getParameterFromSettings().
ApiBase::requireAtLeastOneParameter | ( | $params, | |
$required | |||
) |
Die if none of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | $required,... | Names of parameters of which at least one must be set |
Definition at line 959 of file ApiBase.php.
References dieWithError(), and encodeParamName().
Referenced by ApiQueryStashImageInfo\execute(), ApiTag\execute(), ApiEditPage\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), ApiComparePages\execute(), ApiAMCreateAccount\execute(), ApiLinkAccount\execute(), and ApiClientLogin\execute().
ApiBase::requireMaxOneParameter | ( | $params, | |
$required | |||
) |
Die if more than one of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | $required,... | Names of parameters of which at most one must be set |
Definition at line 931 of file ApiBase.php.
References dieWithError(), and encodeParamName().
Referenced by ApiImport\execute(), ApiExpandTemplates\execute(), ApiQueryLangLinks\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryIWLinks\execute(), ApiQueryBlocks\execute(), ApiParse\execute(), ApiQueryLogEvents\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiQueryUsers\execute(), ApiComparePages\getDiffRevision(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryWatchlist\run(), ApiQueryRevisions\run(), ApiQueryRandom\run(), and ApiQueryRecentChanges\run().
ApiBase::requireOnlyOneParameter | ( | $params, | |
$required | |||
) |
Die if none or more than one of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | $required,... | Names of parameters of which exactly one must be set |
Definition at line 893 of file ApiBase.php.
References dieWithError(), and encodeParamName().
Referenced by ApiMergeHistory\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiStashEdit\execute(), ApiQueryUserContribs\execute(), ApiResetPassword\execute(), ApiRollback\getRbTitle(), getTitleFromTitleOrPageId(), getTitleOrPageId(), ApiUserrights\getUrUser(), and ApiUpload\selectUploadModule().
ApiBase::requirePostedParameters | ( | $params, | |
$prefix = 'prefix' |
|||
) |
Die if any of the specified parameters were found in the query part of the URL rather than the post body.
string[] | $params | Parameters to check |
string | $prefix | Set to 'noprefix' to skip calling $this->encodeParamName() |
Definition at line 989 of file ApiBase.php.
References dieWithError(), encodeParamName(), ContextSource\getConfig(), getMain(), and ContextSource\getRequest().
Referenced by ApiValidatePassword\execute(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\execute(), and ApiLogin\execute().
ApiBase::setContinuationManager | ( | ApiContinuationManager | $manager = null | ) |
Set the continuation manager.
ApiContinuationManager | null | $manager |
Reimplemented in ApiMain.
Definition at line 694 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiImageRotate\execute(), ApiWatch\execute(), ApiPurge\execute(), ApiSetNotificationTimestamp\execute(), and ApiQuery\execute().
|
protected |
Set a watch (or unwatch) based the based on a watchlist parameter.
string | $watch | Valid values: 'watch', 'unwatch', 'preferences', 'nochange' |
Title | $titleObj | The article's title to change |
string | null | $userOption | The user option to consider when $watch=preferences |
Definition at line 1750 of file ApiBase.php.
References WatchAction\doWatchOrUnwatch(), ContextSource\getUser(), and getWatchlistValue().
Referenced by ApiProtect\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiDelete\execute(), and ApiRollback\execute().
ApiBase::shouldCheckMaxlag | ( | ) |
Indicates if this module needs maxlag to be checked.
Reimplemented in ApiHelp.
Definition at line 404 of file ApiBase.php.
|
protected |
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition at line 1871 of file ApiBase.php.
References ContextSource\getRequest(), and wfTransactionalTimeLimit().
Referenced by ApiUndelete\execute(), ApiImageRotate\execute(), ApiMergeHistory\execute(), ApiImport\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiDelete\execute(), ApiRollback\execute(), and ApiSetPageLanguage\execute().
|
protected |
Validate the value against the minimum and user/bot maximum limits.
Prints usage info on failure.
string | $paramName | Parameter name |
int | &$value | Parameter value |
int | null | $min | Minimum value |
int | null | $max | Maximum value for users |
int | null | $botMax | Maximum value for sysops/bots |
bool | $enforceLimits | Whether to enforce (die) if value is outside limits |
Definition at line 1578 of file ApiBase.php.
References ApiMessage\create(), encodeParamName(), getMain(), and warnOrDie().
Referenced by ApiQueryDeletedrevs\execute(), getParameterFromSettings(), and ApiQueryRevisionsBase\parseParameters().
|
protected |
Validate and normalize parameters of type 'timestamp'.
string | $value | Parameter value |
string | $encParamName | Parameter name |
Definition at line 1634 of file ApiBase.php.
References addDeprecation(), dieWithError(), wfEscapeWikiText(), and wfTimestamp().
Referenced by getParameterFromSettings().
|
final |
Validate the supplied token.
string | $token | Supplied token |
array | $params | All supplied parameters for the module |
MWException |
Definition at line 1671 of file ApiBase.php.
References ContextSource\getRequest(), ApiQueryTokens\getToken(), ApiQueryTokens\getTokenTypeSalts(), ContextSource\getUser(), getWebUITokenSalt(), and needsToken().
|
private |
Validate and normalize parameters of type 'user'.
string | $value | Parameter value |
string | $encParamName | Parameter name |
Definition at line 1706 of file ApiBase.php.
References dieWithError(), User\getCanonicalName(), ExternalUserNames\isExternal(), IP\isIPAddress(), User\newFromName(), RE_IP_BYTE, IP\sanitizeIP(), and wfEscapeWikiText().
Referenced by getParameterFromSettings().
|
private |
Adds a warning to the output, else dies.
ApiMessage | $msg | Message to show as a warning, or error message if dying |
bool | $enforceLimits | Whether this is an enforce (die) |
Definition at line 2039 of file ApiBase.php.
References addWarning(), and dieWithError().
Referenced by validateLimit().
|
staticprivate |
$var array Map of web UI block messages to corresponding API messages and codes
Definition at line 281 of file ApiBase.php.
|
staticprivate |
Maps extension paths to info arrays.
Definition at line 275 of file ApiBase.php.
|
staticprivate |
Cache for self::filterIDs()
Definition at line 278 of file ApiBase.php.
|
private |
Definition at line 290 of file ApiBase.php.
|
private |
Definition at line 292 of file ApiBase.php.
Referenced by getModuleName().
string ApiBase::$mModulePrefix |
Definition at line 292 of file ApiBase.php.
Referenced by getModulePrefix().
|
private |
Definition at line 296 of file ApiBase.php.
Referenced by getModuleSourceInfo().
|
private |
Definition at line 294 of file ApiBase.php.
|
private |
Definition at line 293 of file ApiBase.php.
Referenced by getDB().
const ApiBase::ALL_DEFAULT_STRING = '*' |
Definition at line 256 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::GET_VALUES_FOR_HELP = 1 |
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thorough.
E.g. get the list of generators for ApiSandBox extension
Definition at line 272 of file ApiBase.php.
Referenced by ApiQueryLogEvents\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
const ApiBase::LIMIT_BIG1 = 500 |
Fast query, standard limit.
Definition at line 259 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().
const ApiBase::LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit.
Definition at line 261 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().
const ApiBase::LIMIT_SML1 = 50 |
Slow query, standard limit.
Definition at line 263 of file ApiBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryInfo\extractPageInfo(), ApiHelp\getHelpInternal(), PageImages\getImages(), ApiParamInfo\getModuleInfo(), TextExtracts\Hooks\onApiOpenSearchSuggest(), parseMultiValue(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::LIMIT_SML2 = 500 |
Slow query, apihighlimits limit.
Definition at line 265 of file ApiBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryInfo\extractPageInfo(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), parseMultiValue(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::PARAM_ALL = 17 |
(boolean|string) When PARAM_TYPE has a defined set of values and PARAM_ISMULTI is true, this allows for an asterisk ('*') to be passed in place of a pipe-separated list of every possible value.
If a string is set, it will be used in place of the asterisk.
Definition at line 187 of file ApiBase.php.
Referenced by ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_ALLOW_DUPLICATES = 6 |
(boolean) Allow the same value to be set more than once when PARAM_ISMULTI is true?
Definition at line 109 of file ApiBase.php.
Referenced by ApiProtect\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_DEPRECATED = 7 |
(boolean) Is the parameter deprecated (will show a warning)?
Definition at line 112 of file ApiBase.php.
Referenced by ApiQueryStashImageInfo\getAllowedParams(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_DEPRECATED_VALUES = 20 |
(array) When PARAM_TYPE is an array, this indicates which of the values are deprecated.
Keys are the deprecated parameter values, values define the warning message to emit: either boolean true (to use a default message) or a $msg for ApiBase::makeMessage().
Definition at line 209 of file ApiBase.php.
Referenced by ApiQueryUserInfo\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), getFinalParamDescription(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_DFLT = 0 |
(null|boolean|integer|string) Default value of the parameter.
Definition at line 55 of file ApiBase.php.
Referenced by buildCommonApiParams(), buildProfileApiParam(), ApiQueryTitleBlacklist\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiRollback\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiTag\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiOptions\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiMove\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), TextExtracts\ApiQueryExtracts\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiMain\getAllowedParams(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), ApiFormatBase\getParameterFromSettings(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), PageImages\Tests\ApiQueryPageImagesTest\testGetAllowedParams(), and TextExtracts\Test\ApiQueryExtractsTest\testSelfDocumentation().
const ApiBase::PARAM_EXTRA_NAMESPACES = 18 |
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values.
Definition at line 193 of file ApiBase.php.
Referenced by ApiQueryLinks\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_HELP_MSG = 10 |
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Default is apihelp-{$path}-param-{$param}.
Definition at line 131 of file ApiBase.php.
Referenced by SimpleCaptcha\apiGetAllowedParams(), buildCommonApiParams(), buildProfileApiParam(), ApiQueryReferences\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryCategoryInfo\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiPurge\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiLogin\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), TextExtracts\ApiQueryExtracts\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), getFinalParamDescription(), and ApiAuthManagerHelper\getStandardParams().
const ApiBase::PARAM_HELP_MSG_APPEND = 11 |
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this parameter.
Definition at line 138 of file ApiBase.php.
Referenced by ApiRollback\getAllowedParams(), ApiAMCreateAccount\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), and ApiEditPage\getAllowedParams().
const ApiBase::PARAM_HELP_MSG_INFO = 12 |
(array) Specify additional information tags for the parameter.
Value is an array of arrays, with the first member being the 'tag' for the info and the remaining members being the values. In the help, this is formatted using apihelp-{$path}-paraminfo-{$tag}, which is passed $1 = count, $2 = comma-joined list of values, $3 = module prefix.
Definition at line 148 of file ApiBase.php.
Referenced by ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_HELP_MSG_PER_VALUE = 14 |
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg for ApiBase::makeMessage().
Any value not having a mapping will use apihelp-{$path}-paramvalue-{$param}-{$value}. Specify an empty array to use the default message key for all values.
Definition at line 164 of file ApiBase.php.
Referenced by buildProfileApiParam(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), and getFinalParamDescription().
const ApiBase::PARAM_ISMULTI = 1 |
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
titles)?
Definition at line 58 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiSpamBlacklist\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiRollback\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiProtect\getAllowedParams(), ApiImport\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiTag\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiBlock\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiOptions\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiMove\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), and PageImages\Tests\ApiQueryPageImagesTest\testGetAllowedParams().
const ApiBase::PARAM_ISMULTI_LIMIT1 = 21 |
(integer) Maximum number of values, for normal users.
Must be used with PARAM_ISMULTI.
Definition at line 215 of file ApiBase.php.
Referenced by ApiBlock\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_ISMULTI_LIMIT2 = 22 |
(integer) Maximum number of values, for users with the apihighimits right.
Must be used with PARAM_ISMULTI.
Definition at line 222 of file ApiBase.php.
Referenced by ApiBlock\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_MAX = 3 |
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition at line 97 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), TextExtracts\ApiQueryExtracts\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), PageImages\Tests\ApiQueryPageImagesTest\testGetAllowedParams(), and TextExtracts\Test\ApiQueryExtractsTest\testSelfDocumentation().
const ApiBase::PARAM_MAX2 = 4 |
(integer) Max value allowed for the parameter for users with the apihighlimits right, for PARAM_TYPE 'limit'.
Definition at line 103 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), TextExtracts\ApiQueryExtracts\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), PageImages\Tests\ApiQueryPageImagesTest\testGetAllowedParams(), and TextExtracts\Test\ApiQueryExtractsTest\testSelfDocumentation().
const ApiBase::PARAM_MAX_BYTES = 23 |
(integer) Maximum length of a string in bytes (in UTF-8 encoding).
Definition at line 228 of file ApiBase.php.
Referenced by ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_MAX_CHARS = 24 |
(integer) Maximum length of a string in characters (unicode codepoints).
Definition at line 234 of file ApiBase.php.
Referenced by ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_MIN = 5 |
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition at line 106 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), TextExtracts\ApiQueryExtracts\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), PageImages\Tests\ApiQueryPageImagesTest\testGetAllowedParams(), and TextExtracts\Test\ApiQueryExtractsTest\testSelfDocumentation().
const ApiBase::PARAM_RANGE_ENFORCE = 9 |
(boolean) For PARAM_TYPE 'integer', enforce PARAM_MIN and PARAM_MAX?
Definition at line 124 of file ApiBase.php.
Referenced by ApiEditPage\getAllowedParams(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_REQUIRED = 8 |
(boolean) Is the parameter required?
Definition at line 118 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiSpamBlacklist\getAllowedParams(), ApiValidatePassword\getAllowedParams(), ApiCheckToken\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiRollback\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiCategoryTree\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiScribuntoConsole\getAllowedParams(), ApiProtect\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiMove\getAllowedParams(), ApiLogin\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), and ApiAuthManagerHelper\getStandardParams().
const ApiBase::PARAM_SENSITIVE = 19 |
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of the value of this field.
Definition at line 200 of file ApiBase.php.
Referenced by ApiCheckToken\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiLogin\getAllowedParams(), and ApiQueryWatchlist\getAllowedParams().
const ApiBase::PARAM_SUBMODULE_MAP = 15 |
(string[]) When PARAM_TYPE is 'submodule', map parameter values to submodule paths.
Default is to use all modules in $this->getModuleManager() in the group matching the parameter name.
Definition at line 172 of file ApiBase.php.
Referenced by ApiPageSet\getAllowedParams(), getFinalParamDescription(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_SUBMODULE_PARAM_PREFIX = 16 |
(string) When PARAM_TYPE is 'submodule', used to indicate the 'g' prefix added by ApiQueryGeneratorBase (and similar if anything else ever does that).
Definition at line 179 of file ApiBase.php.
Referenced by ApiPageSet\getAllowedParams(), and ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_TEMPLATE_VARS = 25 |
(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 252 of file ApiBase.php.
Referenced by extractRequestParams(), ApiComparePages\getAllowedParams(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
const ApiBase::PARAM_TYPE = 2 |
(string|string[]) Either an array of allowed value strings, or a string type as described below.
If not specified, will be determined from the type of PARAM_DFLT.
Supported string types are:
Definition at line 94 of file ApiBase.php.
Referenced by buildCommonApiParams(), buildProfileApiParam(), ApiValidatePassword\getAllowedParams(), ApiCheckToken\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), MediaWiki\Extension\OATHAuth\Api\Module\ApiQueryOATH\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiTokens\getAllowedParams(), ApiResetPassword\getAllowedParams(), ApiQueryAuthManagerInfo\getAllowedParams(), ApiMergeHistory\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiFileRevert\getAllowedParams(), MediaWiki\Extension\OATHAuth\Api\Module\ApiOATHValidate\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiRollback\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiCategoryTree\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiScribuntoConsole\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiProtect\getAllowedParams(), ApiImport\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiWatch\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiTag\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiBlock\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiOptions\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryPageImages\getAllowedParams(), ApiMove\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiLogin\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQuerySearch\getAllowedParams(), TextExtracts\ApiQueryExtracts\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryUserContribs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiMain\getAllowedParams(), ApiQueryGadgets\getExamplesMessages(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), PageImages\Tests\ApiQueryPageImagesTest\testGetAllowedParams(), and TextExtracts\Test\ApiQueryExtractsTest\testSelfDocumentation().
const ApiBase::PARAM_VALUE_LINKS = 13 |
(string[]) When PARAM_TYPE is an array, this may be an array mapping those values to page titles which will be linked in the help.
Definition at line 155 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal().