MediaWiki
1.30.0
|
This abstract class implements many basic API functions, and is the base of all API classes. More...
Inherits ContextSource.
Inherited by ApiAMCreateAccount, ApiBlock, 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, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiSpamBlacklist, ApiStashEdit, ApiTag, ApiTokens, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, ApiWatch, and MockApi.
Public Member Functions | |
__construct (ApiMain $mainModule, $moduleName, $modulePrefix='') | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). More... | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. More... | |
getConfig () | |
Get the Config object. More... | |
getContext () | |
Get the base IContextSource object. More... | |
getLanguage () | |
Get the Language object. More... | |
getOutput () | |
Get the OutputPage object. More... | |
getRequest () | |
Get the WebRequest object. More... | |
getSkin () | |
Get the Skin object. More... | |
getStats () | |
Get the Stats object. More... | |
getTiming () | |
Get the Timing object. More... | |
getTitle () | |
Get the Title object. More... | |
getUser () | |
Get the User object. More... | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg ( $key) | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
Set the IContextSource object. More... | |
Public Attributes | |
string | $mModulePrefix |
const | 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... | |
Private Attributes | |
ApiMain | $mMainModule |
string | $mModuleName |
array null bool | $mModuleSource = false |
$mParamCache = [] | |
$mSlaveDB = null | |
Static Private Attributes | |
static array | $extensionInfo = null |
Maps extension paths to info arrays. 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 ( $manager) | |
Set the continuation manager. More... | |
getDB () | |
Gets a default replica DB connection object. 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 ( $parseLimit=true) | |
Using getAllowedParams(), this function makes an array of the values provided by the user, with key being the name of the variable, and value - validated value from user or default. More... | |
requireOnlyOneParameter ( $params, $required) | |
Die if none or more than one of a certain set of parameters is set and not false. More... | |
requireMaxOneParameter ( $params, $required) | |
Die if more than one of a certain set of parameters is set and not false. More... | |
requireAtLeastOneParameter ( $params, $required) | |
Die if none of a certain set of parameters is set and not false. More... | |
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 of parameters of type 'timestamp'. More... | |
parameterNotEmpty ( $x) | |
Callback function used in requireOnlyOneParameter to check whether required parameters are set. More... | |
validateUser ( $value, $encParamName) | |
Validate and normalize of parameters of type 'user'. More... | |
Utility methods | |
getWatchlistUser ( $params) | |
Gets the user for whom to get the watchlist. More... | |
errorArrayToStatus (array $errors, User $user=null) | |
Turn an array of message keys or key+param arrays into a Status. More... | |
setWatch ( $watch, $titleObj, $userOption=null) | |
Set a watch (or unwatch) based the based on a watchlist parameter. More... | |
static | truncateArray (&$arr, $limit) |
Truncate an array to a certain length. More... | |
static | makeMessage ( $msg, IContextSource $context, array $params=null) |
Create a Message from a string or array. More... | |
static | escapeWikiText ( $v) |
A subset of wfEscapeWikiText for BC texts. More... | |
Warning and error reporting | |
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']) | |
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 (Block $block) | |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info. More... | |
dieStatus (StatusValue $status) | |
Throw an ApiUsageException based on the Status object. More... | |
dieReadOnly () | |
Helper function for readonly errors. More... | |
checkUserRightsAny ( $rights, $user=null) | |
Helper function for permission-denied errors. More... | |
checkTitleUserPermissions (Title $title, $actions, $user=null) | |
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... | |
Deprecated | |
static | $messageMap |
getModuleProfileName ( $db=false) | |
profileIn () | |
profileOut () | |
safeProfileOut () | |
getProfileTime () | |
profileDBIn () | |
profileDBOut () | |
getProfileDBTime () | |
setWarning ( $warning) | |
dieUsage ( $description, $errorCode, $httpRespCode=0, $extradata=null) | |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message. More... | |
getErrorFromStatus ( $status, &$extraData=null) | |
Get error (as code, string) from a Status object. More... | |
parseMsg ( $error) | |
Return the error message related to a certain array. More... | |
dieUsageMsg ( $error) | |
Output the error message related to a certain array. More... | |
dieUsageMsgOrDebug ( $error) | |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true. More... | |
getDescription () | |
Returns the description string for this module. More... | |
getParamDescription () | |
Returns an array of parameter descriptions. More... | |
getExamples () | |
Returns usage examples for this module. More... | |
useTransactionalTimeLimit () | |
Call wfTransactionalTimeLimit() if this request was POSTed. More... | |
getDescriptionMessage () | |
Return the description message. More... | |
parseMsgInternal ( $error) | |
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 41 of file ApiBase.php.
ApiBase::__construct | ( | ApiMain | $mainModule, |
$moduleName, | |||
$modulePrefix = '' |
|||
) |
ApiMain | $mainModule | |
string | $moduleName | Name of this module |
string | $modulePrefix | Prefix to use for parameter names |
Reimplemented in ApiOpenSearchFormatJson.
Definition at line 257 of file ApiBase.php.
References ContextSource\getContext(), isMain(), and ContextSource\setContext().
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 1793 of file ApiBase.php.
References addWarning(), array(), captcha-old\count, getMain(), logFeatureUsage(), ContextSource\msg(), and Hooks\run().
Referenced by ApiTokens\execute(), ApiExpandTemplates\execute(), ApiQueryDeletedrevs\execute(), ApiLogin\execute(), getParameterFromSettings(), parseMultiValue(), 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 1826 of file ApiBase.php.
References $code, getErrorFormatter(), and getModulePath().
ApiBase::addMessagesFromStatus | ( | StatusValue | $status, |
$types = [ 'warning' , |
|||
'error'] | |||
) |
Add warnings and/or errors from a Status.
StatusValue | $status | |
string[] | $types | 'warning' and/or 'error' |
Definition at line 1838 of file ApiBase.php.
References getErrorFormatter(), and getModulePath().
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() |
Reimplemented in MockApi.
Definition at line 1779 of file ApiBase.php.
References $code, getErrorFormatter(), and getModulePath().
Referenced by addDeprecation(), dieWithErrorOrDebug(), ApiCheckToken\execute(), ApiTokens\execute(), ApiExpandTemplates\execute(), ApiQueryTokens\execute(), ApiOptions\execute(), ApiQueryDisabled\execute(), ApiParamInfo\execute(), ApiPurge\execute(), ApiParse\execute(), ApiQueryUsers\execute(), ApiPageSet\executeInternal(), ApiQueryInfo\extractPageInfo(), ApiQueryRevisionsBase\extractRevisionInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiComparePages\getDiffContent(), 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 | ( | Title | $title, |
$actions, | |||
$user = null |
|||
) |
Helper function for permission-denied errors.
ApiUsageException | if the user doesn't have all of the rights. |
Definition at line 1984 of file ApiBase.php.
References $title, $user, array(), as, dieStatus(), errorArrayToStatus(), and ContextSource\getUser().
Referenced by ApiImageRotate\execute(), ApiProtect\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 1966 of file ApiBase.php.
References $user, array(), dieWithError(), ContextSource\getUser(), and ContextSource\msg().
Referenced by ApiTag\execute(), ApiRevisionDelete\execute(), ApiWatch\execute(), ApiSetNotificationTimestamp\execute(), ApiOptions\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiBlock\execute(), ApiSetPageLanguage\execute(), getWatchlistUser(), ApiQueryDeletedRevisions\run(), and ApiQueryAllDeletedRevisions\run().
ApiBase::dieBlocked | ( | Block | $block | ) |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info.
Block | $block | The block used to generate the ApiUsageException |
ApiUsageException | always |
Definition at line 1895 of file ApiBase.php.
References dieWithError(), ApiQueryUserInfo\getBlockInfo(), Block\getType(), and Block\TYPE_AUTO.
Referenced by ApiUpload\checkPermissions(), ApiTag\execute(), ApiUndelete\execute(), ApiRevisionDelete\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 2026 of file ApiBase.php.
References dieWithError().
Referenced by ApiQueryMyStashedFiles\execute(), ApiQueryBlocks\execute(), ApiQueryLangLinks\execute(), ApiQueryReferences\execute(), ApiQueryIWLinks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiQueryPagePropNames\execute(), ApiQueryLogEvents\execute(), ApiQueryImageInfo\execute(), ApiQueryContributors\execute(), ApiQueryInfo\execute(), ApiQueryContributions\prepareQuery(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategories\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 2038 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(), 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 1950 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 1920 of file ApiBase.php.
References as, and StatusValue\newGood().
Referenced by ApiUpload\checkPermissions(), checkTitleUserPermissions(), ApiUpload\dieRecoverableError(), ApiUpload\dieStatusWithCode(), ApiImageRotate\execute(), ApiManageTags\execute(), ApiTag\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiImport\execute(), ApiRevisionDelete\execute(), ApiChangeAuthenticationData\execute(), ApiUpload\execute(), ApiPatrol\execute(), ApiEditPage\execute(), ApiUnblock\execute(), ApiDelete\execute(), ApiBlock\execute(), ApiRollback\execute(), ApiRemoveAuthenticationData\execute(), ApiUserrights\execute(), ApiSetPageLanguage\execute(), ApiResetPassword\execute(), getParameterFromSettings(), ApiUserrights\getUrUser(), ApiUpload\performStash(), ApiUpload\performUpload(), ApiQuerySearch\run(), ApiQueryRevisions\run(), and ApiWatch\watchTitle().
ApiBase::dieUsage | ( | $description, | |
$errorCode, | |||
$httpRespCode = 0 , |
|||
$extradata = null |
|||
) |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message.
string | $description | One-line human-readable description of the error condition, e.g., "The API requires a valid action parameter" |
string | $errorCode | Brief, arbitrary, stable string to allow easy automated identification of the error, e.g., 'unknown_action' |
int | $httpRespCode | HTTP response code |
array | null | $extradata | Data to add to the "<error>" element; array in ApiResult format |
ApiUsageException | always |
Definition at line 2660 of file ApiBase.php.
References dieWithError(), and wfDeprecated().
Referenced by ApiQueryReferences\execute(), and ApiQueryImageInfo\execute().
ApiBase::dieUsageMsg | ( | $error | ) |
Output the error message related to a certain array.
array | string | MessageSpecifier | $error | Element of a getUserPermissionsErrors()-style array |
ApiUsageException | always |
Definition at line 2920 of file ApiBase.php.
References dieWithError(), parseMsgInternal(), and wfDeprecated().
Referenced by ApiQueryTitleBlacklist\execute().
ApiBase::dieUsageMsgOrDebug | ( | $error | ) |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true.
Otherwise behaves exactly as dieUsageMsg().
array | string | MessageSpecifier | $error | Element of a getUserPermissionsErrors()-style array |
ApiUsageException |
Definition at line 2933 of file ApiBase.php.
References dieWithErrorOrDebug(), parseMsgInternal(), and wfDeprecated().
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 1855 of file ApiBase.php.
References $code, and ApiUsageException\newWithMessage().
Referenced by ApiMain\checkAsserts(), ApiMain\checkBotReadOnly(), ApiMain\checkExecutePermissions(), ApiMain\checkMaxLag(), ApiQueryImageInfo\checkParameterNormalise(), ApiUpload\checkPermissions(), checkUserRightsAny(), ApiUpload\checkVerification(), ApiMain\createPrinterByName(), dieBlocked(), dieContinueUsageIf(), dieReadOnly(), dieUsage(), dieUsageMsg(), dieWithErrorOrDebug(), dieWithException(), ApiCSPReport\error(), ApiValidatePassword\execute(), ApiComparePages\execute(), ApiManageTags\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiEmailUser\execute(), ApiMove\execute(), ApiMergeHistory\execute(), ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiQueryMyStashedFiles\execute(), ApiWatch\execute(), ApiExpandTemplates\execute(), ApiQueryTitleBlacklist\execute(), ApiChangeAuthenticationData\execute(), ApiUpload\execute(), ApiPatrol\execute(), ApiEditPage\execute(), ApiFormatPhp\execute(), ApiLogout\execute(), ApiOptions\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiQueryReferences\execute(), ApiQueryLangLinks\execute(), ApiUnblock\execute(), ApiDisabled\execute(), ApiQueryDeletedrevs\execute(), ApiQueryIWLinks\execute(), ApiQueryFilearchive\execute(), ApiFeedContributions\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiFeedRecentChanges\execute(), ApiQueryContributions\execute(), ApiParse\execute(), ApiQueryLogEvents\execute(), ApiRemoveAuthenticationData\execute(), ApiStashEdit\execute(), ApiUserrights\execute(), ApiSetPageLanguage\execute(), ApiAMCreateAccount\execute(), ApiLinkAccount\execute(), ApiClientLogin\execute(), ApiFeedWatchlist\execute(), ApiResetPassword\execute(), ApiOpenSearchFormatJson\execute(), ApiQueryAllPages\executeGenerator(), ApiQueryAllImages\executeGenerator(), ApiPageSet\executeInternal(), ApiQueryRevisionsBase\extractRevisionInfo(), ApiUpload\getChunkResult(), ApiUpload\getContextResult(), ApiComparePages\getDiffContent(), 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(), ApiQueryContributions\prepareQuery(), ApiQueryBase\prepareUrlQuerySearchString(), ApiQueryBlocks\prepareUsername(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireOnlyOneParameter(), requirePostedParameters(), ApiQueryAllDeletedRevisions\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryCategories\run(), ApiQueryWatchlistRaw\run(), ApiQuerySearch\run(), ApiQueryQueryPage\run(), ApiQueryWatchlist\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ApiUpload\selectUploadModule(), 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 2009 of file ApiBase.php.
References $code, addWarning(), dieWithError(), and ContextSource\getConfig().
Referenced by dieUsageMsgOrDebug(), 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 1867 of file ApiBase.php.
References $options, dieWithError(), and getErrorFormatter().
Referenced by ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiEditPage\execute(), ApiParse\execute(), and ApiComparePages\getDiffContent().
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 710 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 721 of file ApiBase.php.
References $name.
Referenced by ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryLangLinks\execute(), ApiQueryAllMessages\execute(), ApiQueryIWLinks\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiAMCreateAccount\execute(), ApiLinkAccount\execute(), ApiClientLogin\execute(), ApiPageSet\executeInternal(), getParameterFromSettings(), handleParamNormalization(), ApiQueryBlocks\prepareUsername(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireOnlyOneParameter(), requirePostedParameters(), and validateLimit().
Turn an array of message keys or key+param arrays into a Status.
array | $errors | |
User | null | $user |
Definition at line 1726 of file ApiBase.php.
References $user, array(), as, ApiMessage\create(), ApiQueryUserInfo\getBlockInfo(), ContextSource\getUser(), and StatusValue\newGood().
Referenced by checkTitleUserPermissions(), ApiImageRotate\execute(), ApiPatrol\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiRollback\execute(), and ApiMove\moveSubpages().
|
staticprivate |
A subset of wfEscapeWikiText for BC texts.
string | array | $v |
Definition at line 1677 of file ApiBase.php.
Referenced by getExamplesMessages(), getFinalDescription(), and getFinalParamDescription().
|
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, ApiOpenSearchFormatJson, ApiQueryInfo, ApiQuery, ApiPageSet, ApiQueryRecentChanges, ApiQueryBacklinks, ApiQueryUsers, ApiFormatFeedWrapper, ApiFormatRaw, ApiOpenSearch, ApiQueryAllLinks, ApiQueryBacklinksprop, ApiLogin, ApiQueryLinks, ApiFormatJson, ApiQueryAllImages, ApiResetPassword, ApiQueryGadgets, ApiFeedWatchlist, ApiClientLogin, ApiAMCreateAccount, ApiLinkAccount, ApiSetPageLanguage, ApiStashEdit, ApiUserrights, ApiQueryAllUsers, ApiQueryContributors, ApiQueryQueryPage, ApiQueryImageInfo, ApiRemoveAuthenticationData, ApiQueryLogEvents, ApiQueryUserInfo, ApiFeedRecentChanges, ApiParse, ApiQueryContributions, ApiQueryWatchlist, ApiQueryFileRepoInfo, ApiCSPReport, ApiQueryPagePropNames, ApiQueryRevisionsBase, ApiQuerySearch, ApiRollback, ApiBlock, ApiDelete, ApiFeedContributions, ApiQueryWatchlistRaw, ApiFileRevert, ApiPurge, ApiQueryFilearchive, ApiQueryPageProps, ApiDisabled, ApiParamInfo, ApiQueryAllCategories, ApiQueryAllPages, ApiQueryCategoryInfo, ApiQueryDeletedrevs, ApiQueryDisabled, ApiQueryImages, ApiQueryIWLinks, ApiQueryReferences, ApiQueryAllMessages, ApiQueryBlocks, ApiQueryCategories, ApiQueryCategoryMembers, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryPagesWithProp, ApiQueryProtectedTitles, ApiQueryRandom, ApiQueryTags, ApiUnblock, ApiQueryGadgetCategories, ApiEditPage, ApiFormatNone, ApiFormatPhp, ApiHelp, ApiLogout, ApiOptions, ApiQueryAuthManagerInfo, ApiSetNotificationTimestamp, ApiQueryTitleBlacklist, ApiChangeAuthenticationData, ApiExpandTemplates, ApiPatrol, ApiQueryExtLinksUsage, ApiQueryPrefixSearch, ApiQueryTokens, ApiUpload, ApiQueryMyStashedFiles, ApiWatch, ApiImport, ApiQueryStashImageInfo, ApiRevisionDelete, ApiRsd, ApiSpamBlacklist, ApiCheckToken, ApiEmailUser, ApiMergeHistory, ApiMove, ApiTokens, ApiUndelete, ApiClearHasMsg, ApiProtect, ApiManageTags, ApiTag, ApiImageRotate, ApiComparePages, ApiValidatePassword, ApiFancyCaptchaReload, MockApi, and MockApiQueryBase.
|
protected |
Split a multi-valued parameter string, like explode()
string | $value | |
int | $limit |
Definition at line 1350 of file ApiBase.php.
References $value.
Referenced by ApiPageSet\handleParamNormalization(), and parseMultiValue().
ApiBase::extractRequestParams | ( | $parseLimit = true | ) |
Using getAllowedParams(), this function makes an array of the values provided by the user, with key being the name of the variable, and value - validated value from user or default.
limits will not be parsed if $parseLimit is set to false; use this when the max limit is not definitive yet, e.g. when getting revisions.
bool | $parseLimit | True by default |
Definition at line 740 of file ApiBase.php.
References $params, as, getFinalParams(), and getParameterFromSettings().
Referenced by ApiAuthManagerHelper\__construct(), ApiPageSet\__construct(), ApiValidatePassword\execute(), ApiComparePages\execute(), ApiImageRotate\execute(), ApiTag\execute(), ApiManageTags\execute(), ApiProtect\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiMergeHistory\execute(), ApiCheckToken\execute(), ApiSpamBlacklist\execute(), ApiTokens\execute(), ApiEmailUser\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiImport\execute(), ApiQueryMyStashedFiles\execute(), ApiWatch\execute(), ApiQueryTitleBlacklist\execute(), ApiExpandTemplates\execute(), ApiPatrol\execute(), ApiQueryTokens\execute(), ApiUpload\execute(), ApiOptions\execute(), ApiQueryGadgetCategories\execute(), ApiFormatPhp\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryAuthManagerInfo\execute(), ApiHelp\execute(), ApiEditPage\execute(), ApiQueryBlocks\execute(), ApiQueryLangLinks\execute(), ApiQueryReferences\execute(), ApiQueryTags\execute(), ApiQueryAllMessages\execute(), ApiUnblock\execute(), ApiQueryExternalLinks\execute(), ApiQueryIWLinks\execute(), ApiParamInfo\execute(), ApiQueryCategoryInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiFileRevert\execute(), ApiPurge\execute(), ApiBlock\execute(), ApiFeedContributions\execute(), ApiDelete\execute(), ApiQueryPagePropNames\execute(), ApiRollback\execute(), ApiQueryFileRepoInfo\execute(), ApiFeedRecentChanges\execute(), ApiParse\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryUserInfo\execute(), ApiQueryImageInfo\execute(), ApiRemoveAuthenticationData\execute(), ApiQueryContributors\execute(), ApiQueryAllUsers\execute(), ApiStashEdit\execute(), ApiUserrights\execute(), ApiSetPageLanguage\execute(), ApiAMCreateAccount\execute(), ApiLinkAccount\execute(), ApiClientLogin\execute(), ApiFeedWatchlist\execute(), ApiQueryGadgets\execute(), ApiResetPassword\execute(), ApiFormatJson\execute(), ApiLogin\execute(), ApiOpenSearch\execute(), ApiQueryUsers\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getFormat(), ApiFormatJson\getMimeType(), ApiComparePages\guessTitleAndModel(), ApiQuery\isReadMode(), ApiQueryDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryImages\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryWatchlistRaw\run(), ApiQueryCategories\run(), ApiQueryDuplicateFiles\run(), ApiQueryPagesWithProp\run(), ApiQuerySearch\run(), ApiQueryAllCategories\run(), ApiQueryQueryPage\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryCategoryMembers\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), and ApiMain\setupExecuteAction().
|
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, ApiQueryImageInfo, ApiQueryRecentChanges, ApiParamInfo, ApiEditPage, ApiQueryBacklinks, ApiQueryContributions, ApiQueryRevisionsBase, ApiQueryRevisions, ApiComparePages, ApiQueryDeletedrevs, ApiStashEdit, ApiQueryWatchlist, ApiQueryAllDeletedRevisions, ApiQueryUsers, ApiQueryBacklinksprop, ApiFormatBase, ApiQuerySearch, ApiQueryAllImages, ApiQueryAllUsers, ApiQueryUserInfo, ApiQueryCategoryMembers, ApiOpenSearch, ApiQueryAllPages, ApiQueryBlocks, ApiLogin, ApiQueryDeletedRevisions, ApiQueryFilearchive, ApiQueryAllLinks, ApiMove, ApiQueryAllRevisions, ApiQueryContributors, ApiQueryAllMessages, ApiCSPReport, ApiExpandTemplates, ApiFeedContributions, ApiQueryGadgets, ApiDelete, ApiQueryProtectedTitles, ApiQueryRandom, ApiQueryLinks, ApiQueryCategories, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiQueryDuplicateFiles, ApiQueryAllCategories, ApiBlock, ApiRevisionDelete, ApiUserrights, ApiQueryIWLinks, ApiQueryExtLinksUsage, ApiQueryLangLinks, ApiOptions, ApiProtect, ApiTag, ApiQueryQueryPage, ApiQueryImages, ApiQueryWatchlistRaw, ApiImport, ApiQueryTags, ApiQueryPagesWithProp, ApiFeedRecentChanges, ApiQueryMyStashedFiles, ApiClientLogin, ApiAMCreateAccount, ApiFormatJson, ApiSetPageLanguage, ApiFileRevert, ApiLinkAccount, ApiMergeHistory, ApiQueryExternalLinks, ApiRollback, ApiQueryTokens, ApiUndelete, ApiQueryPageProps, ApiQueryPrefixSearch, ApiUnblock, ApiQueryCategoryInfo, ApiQueryAuthManagerInfo, ApiTokens, ApiResetPassword, ApiRemoveAuthenticationData, ApiEmailUser, ApiQueryPagePropNames, ApiManageTags, ApiPatrol, ApiQueryGadgetCategories, ApiQueryTitleBlacklist, ApiQueryStashImageInfo, ApiFormatPhp, ApiChangeAuthenticationData, ApiQueryFileRepoInfo, ApiCheckToken, ApiValidatePassword, ApiSpamBlacklist, ApiQueryDisabled, ApiQueryReferences, ApiFancyCaptchaReload, and MockApi.
Definition at line 386 of file ApiBase.php.
Referenced by getFinalParams().
ApiBase::getConditionalRequestData | ( | $condition | ) |
Returns data for HTTP conditional request mechanisms.
string | $condition | Condition being queried:
|
Definition at line 497 of file ApiBase.php.
ApiBase::getContinuationManager | ( | ) |
Get the continuation manager.
Reimplemented in ApiMain.
Definition at line 672 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, ApiFeedWatchlist, ApiFeedContributions, and ApiFeedRecentChanges.
Definition at line 308 of file ApiBase.php.
|
protected |
Gets a default replica DB connection object.
Reimplemented in ApiPageSet, ApiQueryBase, and ApiQueryAllImages.
Definition at line 660 of file ApiBase.php.
References $mSlaveDB, DB_REPLICA, and wfGetDB().
Referenced by ApiQuery\doExport(), ApiParse\formatCategoryLinks(), ApiComparePages\getDiffContent(), ApiComparePages\guessTitleAndModel(), and ApiOpenSearch\search().
|
protected |
Returns the description string for this module.
Ignored if an i18n message exists for "apihelp-{$this->getModulePath()}-description".
Definition at line 2522 of file ApiBase.php.
Referenced by getFinalDescription().
|
protected |
Return the description message.
This is additional text to display on the help page after the summary.
Reimplemented in ApiDisabled, and ApiQueryDisabled.
Definition at line 2946 of file ApiBase.php.
Referenced by getFinalDescription(), and getFinalSummary().
ApiBase::getErrorFormatter | ( | ) |
Get the error formatter.
Reimplemented in ApiMain.
Definition at line 646 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), dieWithException(), ApiValidatePassword\execute(), ApiImageRotate\execute(), ApiManageTags\execute(), ApiEmailUser\execute(), ApiMove\execute(), ApiLogout\execute(), ApiFileRevert\execute(), ApiLogin\execute(), ApiQueryUsers\execute(), ApiRevisionDelete\extractStatusInfo(), ApiLogin\formatMessage(), ApiUpload\handleStashException(), ApiMove\moveSubpages(), ApiUpload\performStash(), ApiTag\processIndividual(), ApiPageSet\processTitlesArray(), setWarning(), and ApiWatch\watchTitle().
ApiBase::getErrorFromStatus | ( | $status, | |
& | $extraData = null |
||
) |
Get error (as code, string) from a Status object.
Status | $status | |
array | null | &$extraData | Set if extra data from IApiMessage is available (since 1.27) |
MWException |
Definition at line 2680 of file ApiBase.php.
References $params, ApiMessage\create(), ApiErrorFormatter\stripMarkup(), and wfDeprecated().
|
protected |
Returns usage examples for this module.
Return value as an array is either:
Definition at line 2558 of file ApiBase.php.
Referenced by getExamplesMessages().
|
protected |
Returns usage examples for this module.
Return value has query strings as keys, with values being either strings (message key), arrays (message key + parameter), or Message objects.
Do not call this base class implementation when overriding this method.
Reimplemented in ApiMain, ApiQueryInfo, ApiUpload, ApiParse, ApiHelp, ApiQueryImageInfo, ApiQueryRecentChanges, ApiEditPage, ApiQueryContributions, ApiParamInfo, ApiQueryBacklinks, ApiQuery, ApiQueryDeletedrevs, ApiQueryWatchlist, ApiQueryRevisions, ApiComparePages, ApiQueryLogEvents, ApiQueryAllDeletedRevisions, ApiQueryBacklinksprop, ApiQueryAllImages, ApiQuerySearch, ApiQueryUsers, ApiQueryAllUsers, ApiQueryCategoryMembers, ApiFormatBase, ApiQueryAllPages, ApiQueryUserInfo, ApiQueryBlocks, ApiOpenSearch, ApiFeedWatchlist, ApiQueryFilearchive, ApiQueryAllLinks, ApiMove, ApiQueryAllRevisions, ApiQueryDeletedRevisions, ApiLogin, ApiQueryAllMessages, ApiQueryContributors, ApiQueryProtectedTitles, ApiSetNotificationTimestamp, ApiFeedContributions, ApiQueryExtLinksUsage, ApiExpandTemplates, ApiDelete, ApiQueryCategories, ApiQueryGadgets, ApiQueryRandom, ApiQueryLinks, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiUserrights, ApiRollback, ApiQueryAllCategories, ApiImageRotate, ApiQueryWatchlistRaw, ApiRevisionDelete, ApiQueryIWLinks, ApiProtect, ApiFeedRecentChanges, ApiQueryLangLinks, ApiBlock, ApiQueryDuplicateFiles, ApiTag, ApiOptions, ApiWatch, ApiPurge, ApiImport, ApiQueryImages, ApiQueryPagesWithProp, ApiQueryQueryPage, ApiQueryTags, ApiQueryMyStashedFiles, ApiUndelete, ApiSetPageLanguage, ApiFileRevert, ApiQueryExternalLinks, ApiMergeHistory, ApiAMCreateAccount, ApiUnblock, ApiClientLogin, ApiQueryPrefixSearch, ApiResetPassword, ApiLinkAccount, ApiQueryAuthManagerInfo, ApiQueryPageProps, ApiQueryStashImageInfo, ApiQueryTokens, ApiManageTags, ApiQueryCategoryInfo, ApiEmailUser, ApiTokens, ApiQueryFileRepoInfo, ApiQueryReferences, ApiPatrol, ApiQueryTitleBlacklist, ApiQueryGadgetCategories, ApiQueryPagePropNames, ApiRemoveAuthenticationData, ApiChangeAuthenticationData, ApiCheckToken, ApiLogout, ApiValidatePassword, ApiSpamBlacklist, ApiRsd, ApiClearHasMsg, and ApiFancyCaptchaReload.
Definition at line 323 of file ApiBase.php.
References $ret, as, captcha-old\count, escapeWikiText(), getExamples(), and ContextSource\msg().
|
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 2087 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 2131 of file ApiBase.php.
References escapeWikiText(), ContextSource\getContext(), getDescription(), getDescriptionMessage(), getExtendedDescription(), getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), makeMessage(), ContextSource\msg(), Hooks\run(), string, and wfDeprecated().
ApiBase::getFinalParamDescription | ( | ) |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed.
Definition at line 2217 of file ApiBase.php.
References $line, $name, $params, $path, $value, as, dieDebug(), escapeWikiText(), ContextSource\getContext(), getFinalParams(), getModuleFromPath(), getModuleManager(), getModuleName(), getModulePath(), getModulePrefix(), getParamDescription(), 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 2185 of file ApiBase.php.
References $flags, $params, getAllowedParams(), needsToken(), and Hooks\run().
Referenced by extractRequestParams(), getFinalParamDescription(), and getParameter().
ApiBase::getFinalSummary | ( | ) |
Get final module summary.
Ideally this will just be the getSummaryMessage(). However, for backwards compatibility, if that message does not exist then the first line of wikitext from the description message will be used instead.
Definition at line 2104 of file ApiBase.php.
References ContextSource\getContext(), getDescriptionMessage(), getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), makeMessage(), and wfDeprecated().
|
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 2381 of file ApiBase.php.
References $flags, isDeprecated(), isInternal(), isReadMode(), isWriteMode(), and mustBePosted().
ApiBase::getHelpUrls | ( | ) |
Return links to more detailed help pages about the module.
Reimplemented in ApiQueryInfo, ApiUpload, ApiParse, ApiHelp, ApiQueryImageInfo, ApiQueryRecentChanges, ApiEditPage, ApiQueryContributions, ApiParamInfo, ApiQueryBacklinks, ApiQuery, ApiQueryDeletedrevs, ApiQueryRevisions, ApiQueryWatchlist, ApiQueryLogEvents, ApiQueryAllDeletedRevisions, ApiQueryBacklinksprop, ApiQueryAllImages, ApiQuerySearch, ApiQueryUsers, ApiQueryCategoryMembers, ApiQueryAllUsers, ApiFormatBase, ApiQueryAllPages, ApiQueryUserInfo, ApiQueryBlocks, ApiOpenSearch, ApiFeedWatchlist, ApiQueryAllLinks, ApiQueryFilearchive, ApiMove, ApiQueryAllRevisions, ApiQueryDeletedRevisions, ApiLogin, ApiQueryAllMessages, ApiQueryContributors, ApiSetNotificationTimestamp, ApiQueryProtectedTitles, ApiQueryExtLinksUsage, ApiDelete, ApiExpandTemplates, ApiQueryCategories, ApiQueryLinks, ApiQueryRandom, ApiQueryIWBacklinks, ApiQueryLangBacklinks, ApiUserrights, ApiRollback, ApiQueryAllCategories, ApiProtect, ApiQueryWatchlistRaw, ApiRevisionDelete, ApiQueryIWLinks, ApiBlock, ApiQueryLangLinks, ApiQueryDuplicateFiles, ApiTag, ApiWatch, ApiPurge, ApiQueryImages, ApiQueryPagesWithProp, ApiImport, ApiOptions, ApiQueryQueryPage, ApiQueryTags, ApiUndelete, ApiQueryMyStashedFiles, ApiSetPageLanguage, ApiMergeHistory, ApiQueryExternalLinks, ApiResetPassword, ApiAMCreateAccount, ApiClientLogin, ApiUnblock, ApiQueryTokens, ApiQueryAuthManagerInfo, ApiQueryPrefixSearch, ApiManageTags, ApiLinkAccount, ApiQueryStashImageInfo, ApiQueryPageProps, ApiQueryCategoryInfo, ApiEmailUser, ApiPatrol, ApiQueryFileRepoInfo, ApiQueryPagePropNames, ApiRemoveAuthenticationData, ApiChangeAuthenticationData, ApiValidatePassword, ApiLogout, ApiSpamBlacklist, and ApiClearHasMsg.
Definition at line 370 of file ApiBase.php.
ApiBase::getMain | ( | ) |
Get the main module.
Definition at line 528 of file ApiBase.php.
References $mMainModule.
Referenced by ApiFormatJson\__construct(), ApiFormatBase\__construct(), ApiContinuationManager\__construct(), ApiQueryBase\__construct(), ApiPageSet\__construct(), addDeprecation(), ApiFormatBase\closePrinter(), ApiComparePages\execute(), ApiExpandTemplates\execute(), ApiUpload\execute(), ApiHelp\execute(), ApiEditPage\execute(), ApiQueryGadgetCategories\execute(), ApiParamInfo\execute(), ApiQueryDeletedrevs\execute(), ApiParse\execute(), ApiFeedRecentChanges\execute(), ApiQueryGadgets\execute(), ApiFeedWatchlist\execute(), ApiOpenSearch\execute(), ApiQuery\execute(), ApiPageSet\executeInternal(), ApiQueryInfo\extractPageInfo(), ApiParamInfo\getAllowedParams(), ApiUpload\getChunkResult(), getContinuationManager(), ApiQueryUserInfo\getCurrentUserInfo(), ApiFeedRecentChanges\getCustomPrinter(), ApiFeedContributions\getCustomPrinter(), ApiFeedWatchlist\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(), TitleBlacklistHooks\onAddNewAccountApiForm(), 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 594 of file ApiBase.php.
References $path, captcha-old\count, dieWithError(), getMain(), and wfEscapeWikiText().
Referenced by ApiHelp\execute(), ApiParamInfo\execute(), getFinalParamDescription(), ApiParamInfo\getModuleInfo(), ApiStructureTest\testDocumentationExists(), and ApiStructureTest\testParameterConsistency().
ApiBase::getModuleManager | ( | ) |
Get the module manager, or null if this module has no sub-modules.
Reimplemented in ApiMain, and ApiQuery.
Definition at line 295 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.
Reimplemented in MockApiQueryBase.
Definition at line 512 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(), ApiComparePages\execute(), ApiImageRotate\execute(), ApiTag\execute(), ApiManageTags\execute(), ApiProtect\execute(), ApiClearHasMsg\execute(), ApiUndelete\execute(), ApiMove\execute(), ApiMergeHistory\execute(), ApiEmailUser\execute(), ApiTokens\execute(), ApiCheckToken\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiImport\execute(), ApiQueryMyStashedFiles\execute(), ApiWatch\execute(), ApiPatrol\execute(), ApiQueryTokens\execute(), ApiExpandTemplates\execute(), ApiUpload\execute(), ApiOptions\execute(), ApiQueryAuthManagerInfo\execute(), ApiEditPage\execute(), ApiSetNotificationTimestamp\execute(), ApiHelp\execute(), ApiQueryTags\execute(), ApiQueryAllMessages\execute(), ApiUnblock\execute(), ApiQueryBlocks\execute(), ApiParamInfo\execute(), ApiDisabled\execute(), ApiQueryDeletedrevs\execute(), ApiQueryDisabled\execute(), ApiFileRevert\execute(), ApiPurge\execute(), ApiQueryFilearchive\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiQueryPagePropNames\execute(), ApiCSPReport\execute(), ApiRollback\execute(), ApiParse\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryUserInfo\execute(), ApiRemoveAuthenticationData\execute(), ApiQueryAllUsers\execute(), ApiUserrights\execute(), ApiStashEdit\execute(), ApiSetPageLanguage\execute(), ApiQueryUsers\execute(), ApiQueryBacklinksprop\getAllowedParams(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiFormatBase\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiQueryAllLinks\getHelpUrls(), ApiQueryBacklinksprop\getHelpUrls(), ApiQueryGadgetCategories\getList(), MockApi\getModulePath(), getModulePath(), getParameterFromSettings(), ApiAuthManagerHelper\logAuthenticationResult(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryPrefixSearch\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryProtectedTitles\run(), ApiQueryExtLinksUsage\run(), ApiQueryWatchlistRaw\run(), ApiQueryPagesWithProp\run(), ApiQuerySearch\run(), ApiQueryAllCategories\run(), ApiQueryQueryPage\run(), ApiQueryWatchlist\run(), ApiQueryAllPages\run(), ApiQueryCategoryMembers\run(), ApiQueryAllImages\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), and ApiUpload\selectUploadModule().
ApiBase::getModulePath | ( | ) |
Get the path to this module.
Reimplemented in MockApiQueryBase, and MockApi.
Definition at line 576 of file ApiBase.php.
References getModuleName(), getParent(), and isMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiHelp\getHelp(), ApiStructureTest\provideDocumentationExists(), ApiStructureTest\provideParameterConsistency(), and setWarning().
ApiBase::getModulePrefix | ( | ) |
Get parameter prefix (usually two letters or an empty string).
Definition at line 520 of file ApiBase.php.
References $mModulePrefix.
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryStashImageInfo\execute(), ApiQueryDeletedrevs\execute(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllLinks\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllDeletedRevisions\run(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryExtLinksUsage\run(), ApiQueryAllImages\run(), ApiQueryRevisions\run(), and ApiQueryAllLinks\run().
ApiBase::getModuleProfileName | ( | $db = false | ) |
IDatabase | bool | $db |
Definition at line 2567 of file ApiBase.php.
References wfDeprecated().
|
protected |
Returns information about the source of this module, if known.
Returned array is an array with the following keys:
Definition at line 2414 of file ApiBase.php.
References $ext, $IP, $mModuleSource, $path, as, ContextSource\getConfig(), ExtensionRegistry\getInstance(), and global.
|
protected |
Returns an array of parameter descriptions.
For each parameter, ignored if an i18n message exists for the parameter. By default that message is "apihelp-{$this->getModulePath()}-param-{$param}", but it may be overridden using ApiBase::PARAM_HELP_MSG in the data returned by self::getFinalParams().
Definition at line 2538 of file ApiBase.php.
Referenced by getFinalParamDescription().
|
protected |
Get a value for the given parameter.
string | $paramName | Parameter name |
bool | $parseLimit | See extractRequestParams() |
Definition at line 764 of file ApiBase.php.
References getFinalParams(), and getParameterFromSettings().
Referenced by ApiFormatRaw\__construct(), ApiMain\addRequestedFields(), ApiCSPReport\execute(), ApiFeedRecentChanges\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 | Parse limit? |
Reimplemented in ApiFormatBase.
Definition at line 1023 of file ApiBase.php.
References $name, $request, $type, $value, addDeprecation(), ALL_DEFAULT_STRING, array(), as, ChangeTags\canAddTagsAccompanyingChange(), dieDebug(), dieStatus(), dieWithError(), encodeParamName(), getMain(), getModuleManager(), getModuleName(), getResult(), MWNamespace\getValidNamespaces(), 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(), and getParameter().
ApiBase::getParent | ( | ) |
Get the parent of this module.
Reimplemented in ApiQueryBase.
Definition at line 546 of file ApiBase.php.
References getMain(), and isMain().
Referenced by getModulePath().
ApiBase::getProfileDBTime | ( | ) |
Definition at line 2622 of file ApiBase.php.
References wfDeprecated().
ApiBase::getProfileTime | ( | ) |
Definition at line 2599 of file ApiBase.php.
References wfDeprecated().
ApiBase::getResult | ( | ) |
Get the result object.
Reimplemented in ApiMain.
Definition at line 632 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(), ApiComparePages\execute(), ApiImageRotate\execute(), ApiManageTags\execute(), ApiTag\execute(), ApiProtect\execute(), ApiClearHasMsg\execute(), ApiUndelete\execute(), ApiSpamBlacklist\execute(), ApiEmailUser\execute(), ApiCheckToken\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiTokens\execute(), ApiImport\execute(), ApiQueryStashImageInfo\execute(), ApiRevisionDelete\execute(), ApiRsd\execute(), ApiQueryMyStashedFiles\execute(), ApiWatch\execute(), ApiExpandTemplates\execute(), ApiChangeAuthenticationData\execute(), ApiQueryTokens\execute(), ApiPatrol\execute(), ApiQueryTitleBlacklist\execute(), ApiUpload\execute(), ApiHelp\execute(), ApiEditPage\execute(), ApiOptions\execute(), ApiSetNotificationTimestamp\execute(), ApiFormatPhp\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryTags\execute(), ApiUnblock\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), ApiParamInfo\execute(), ApiQueryFilearchive\execute(), ApiQueryPageProps\execute(), ApiFileRevert\execute(), ApiPurge\execute(), ApiBlock\execute(), ApiDelete\execute(), ApiFeedContributions\execute(), ApiRollback\execute(), ApiQueryPagePropNames\execute(), ApiCSPReport\execute(), ApiQueryFileRepoInfo\execute(), ApiFeedRecentChanges\execute(), ApiParse\execute(), ApiQueryContributions\execute(), ApiQueryLogEvents\execute(), ApiQueryUserInfo\execute(), ApiQueryImageInfo\execute(), ApiRemoveAuthenticationData\execute(), ApiQueryContributors\execute(), ApiQueryAllUsers\execute(), ApiStashEdit\execute(), ApiUserrights\execute(), ApiLinkAccount\execute(), ApiSetPageLanguage\execute(), ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiFeedWatchlist\execute(), ApiResetPassword\execute(), ApiFormatJson\execute(), ApiLogin\execute(), ApiFormatRaw\execute(), ApiFormatFeedWrapper\execute(), ApiQueryUsers\execute(), ApiQuery\execute(), ApiQueryInfo\execute(), ApiOpenSearchFormatJson\execute(), ApiFormatRaw\getFilename(), ApiQueryGadgetCategories\getList(), ApiFormatRaw\getMimeType(), getParameterFromSettings(), ApiFormatRaw\initPrinter(), ApiFormatFeedWrapper\initPrinter(), ApiQuery\outputGeneralPageInfo(), ApiQueryRevisionsBase\parseParameters(), ApiOpenSearch\populateResult(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryWatchlistRaw\run(), ApiQueryPagesWithProp\run(), ApiQueryAllCategories\run(), ApiQuerySearch\run(), ApiQueryQueryPage\run(), ApiQueryWatchlist\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryRandom\runQuery(), ApiUpload\selectUploadModule(), and ApiQueryGadgets\setIndexedTagNameForMetadata().
|
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 2074 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 954 of file ApiBase.php.
References $params, 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 917 of file ApiBase.php.
References $params, 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 1647 of file ApiBase.php.
References $params, $user, 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 | $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 982 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.
Definition at line 481 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 1338 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 436 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 ApiStashEdit, and ApiCSPReport.
Definition at line 446 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 537 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, ApiLogin, ApiCSPReport, ApiQueryTokens, ApiClientLogin, ApiAMCreateAccount, ApiLinkAccount, ApiQueryAuthManagerInfo, ApiLogout, ApiRsd, and ApiDisabled.
Definition at line 404 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, ApiStashEdit, ApiMove, ApiCSPReport, ApiSetNotificationTimestamp, ApiDelete, ApiImageRotate, ApiBlock, ApiRevisionDelete, ApiUserrights, ApiWatch, ApiPurge, ApiOptions, ApiProtect, ApiTag, ApiImport, ApiSetPageLanguage, ApiAMCreateAccount, ApiFileRevert, ApiMergeHistory, ApiRollback, ApiLinkAccount, ApiUndelete, ApiUnblock, ApiEmailUser, ApiRemoveAuthenticationData, ApiResetPassword, ApiManageTags, ApiPatrol, ApiChangeAuthenticationData, and ApiClearHasMsg.
Definition at line 419 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 560 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 2048 of file ApiBase.php.
References $request, $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 | $params |
Definition at line 1701 of file ApiBase.php.
References ContextSource\$context, $params, and wfMessage().
Referenced by ApiStructureTest\checkMessage(), ApiAMCreateAccount\getFinalDescription(), ApiLinkAccount\getFinalDescription(), ApiClientLogin\getFinalDescription(), getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
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 2503 of file ApiBase.php.
ApiBase::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Reimplemented in ApiUpload, ApiEditPage, ApiStashEdit, ApiLogin, ApiMove, ApiCSPReport, ApiSetNotificationTimestamp, ApiDelete, ApiImageRotate, ApiPurge, ApiBlock, ApiRevisionDelete, ApiUserrights, ApiWatch, ApiOptions, ApiProtect, ApiTag, ApiImport, ApiSetPageLanguage, ApiFileRevert, ApiMergeHistory, ApiRollback, ApiUndelete, ApiUnblock, ApiEmailUser, ApiManageTags, ApiPatrol, ApiValidatePassword, and ApiClearHasMsg.
Definition at line 427 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, ApiStashEdit, ApiMove, ApiDelete, ApiSetNotificationTimestamp, ApiUserrights, ApiImageRotate, ApiRevisionDelete, ApiProtect, ApiBlock, ApiTag, ApiOptions, ApiImport, ApiWatch, ApiRollback, ApiUndelete, ApiSetPageLanguage, ApiFileRevert, ApiMergeHistory, ApiUnblock, ApiClientLogin, ApiManageTags, ApiAMCreateAccount, ApiEmailUser, ApiLinkAccount, ApiPatrol, ApiRemoveAuthenticationData, ApiResetPassword, and ApiChangeAuthenticationData.
Definition at line 468 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 902 of file ApiBase.php.
ApiBase::parseMsg | ( | $error | ) |
Return the error message related to a certain array.
array | string | MessageSpecifier | $error | Element of a getUserPermissionsErrors()-style array |
Definition at line 2890 of file ApiBase.php.
References parseMsgInternal(), ApiErrorFormatter\stripMarkup(), wfDebug(), wfDeprecated(), and wfGetAllCallers().
|
private |
array | string | MessageSpecifier | $error | Element of a getUserPermissionsErrors()-style array |
Definition at line 2869 of file ApiBase.php.
References $params, ApiMessage\create(), and wfEscapeWikiText().
Referenced by dieUsageMsg(), dieUsageMsgOrDebug(), and parseMsg().
|
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 1378 of file ApiBase.php.
References $value, addDeprecation(), addWarning(), captcha-old\count, dieWithError(), explodeMultiValue(), LIMIT_SML1, LIMIT_SML2, and wfEscapeWikiText().
Referenced by getParameterFromSettings().
ApiBase::profileDBIn | ( | ) |
ApiBase::profileDBOut | ( | ) |
ApiBase::profileIn | ( | ) |
Definition at line 2575 of file ApiBase.php.
ApiBase::profileOut | ( | ) |
Definition at line 2583 of file ApiBase.php.
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 842 of file ApiBase.php.
References $params, captcha-old\count, dieWithError(), and encodeParamName().
Referenced by ApiComparePages\execute(), ApiTag\execute(), ApiQueryStashImageInfo\execute(), ApiEditPage\execute(), ApiStashEdit\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 814 of file ApiBase.php.
References $params, captcha-old\count, dieWithError(), and encodeParamName().
Referenced by ApiImport\execute(), ApiExpandTemplates\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryLangLinks\execute(), ApiQueryBlocks\execute(), ApiQueryIWLinks\execute(), ApiParse\execute(), ApiQueryLogEvents\execute(), ApiQueryAllUsers\execute(), ApiQueryContributors\execute(), ApiQueryUsers\execute(), 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 776 of file ApiBase.php.
References $params, captcha-old\count, dieWithError(), and encodeParamName().
Referenced by ApiMergeHistory\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiUnblock\execute(), ApiBlock\execute(), ApiQueryContributions\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 872 of file ApiBase.php.
References $params, as, captcha-old\count, dieWithError(), encodeParamName(), ContextSource\getConfig(), getMain(), and ContextSource\getRequest().
Referenced by ApiValidatePassword\execute(), and ApiLogin\execute().
ApiBase::safeProfileOut | ( | ) |
ApiBase::setContinuationManager | ( | $manager | ) |
Set the continuation manager.
ApiContinuationManager | null | $manager |
Reimplemented in ApiMain.
Definition at line 686 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiImageRotate\execute(), ApiWatch\execute(), ApiSetNotificationTimestamp\execute(), ApiPurge\execute(), and ApiQuery\execute().
ApiBase::setWarning | ( | $warning | ) |
string | $warning | Warning message |
Definition at line 2641 of file ApiBase.php.
References getErrorFormatter(), getModulePath(), and wfDeprecated().
|
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 | $userOption | The user option to consider when $watch=preferences |
Definition at line 1616 of file ApiBase.php.
References $value, 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 396 of file ApiBase.php.
|
static |
Truncate an array to a certain length.
array | &$arr | Array to truncate |
int | $limit | Maximum length |
Definition at line 1631 of file ApiBase.php.
References captcha-old\count.
|
protected |
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition at line 2631 of file ApiBase.php.
References ContextSource\getRequest(), and wfTransactionalTimeLimit().
Referenced by ApiImageRotate\execute(), ApiUndelete\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiImport\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 | $botMax | Maximum value for sysops/bots |
bool | $enforceLimits | Whether to enforce (die) if value is outside limits |
Definition at line 1466 of file ApiBase.php.
References $value, ApiMessage\create(), encodeParamName(), getMain(), and warnOrDie().
Referenced by ApiQueryDeletedrevs\execute(), getParameterFromSettings(), and ApiQueryRevisionsBase\parseParameters().
|
protected |
Validate and normalize of parameters of type 'timestamp'.
string | $value | Parameter value |
string | $encParamName | Parameter name |
Definition at line 1519 of file ApiBase.php.
References $value, 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 1556 of file ApiBase.php.
References ContextSource\getRequest(), ApiQueryTokens\getToken(), ApiQueryTokens\getTokenTypeSalts(), ContextSource\getUser(), getWebUITokenSalt(), and needsToken().
|
private |
Validate and normalize of parameters of type 'user'.
string | $value | Parameter value |
string | $encParamName | Parameter name |
Definition at line 1591 of file ApiBase.php.
References $title, $value, dieWithError(), Title\makeTitleSafe(), NS_USER, 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 1879 of file ApiBase.php.
References addWarning(), and dieWithError().
Referenced by validateLimit().
|
staticprivate |
Maps extension paths to info arrays.
Definition at line 241 of file ApiBase.php.
|
staticprivate |
Prior to 1.29, this was a public mapping from arbitrary strings (often message keys used elsewhere in MediaWiki) to API codes and message texts, and a few interfaces required poking something in here. Now we're repurposing it to map those same strings to i18n messages, and declaring that any interface that requires poking at this is broken and needs replacing ASAP.
Definition at line 2722 of file ApiBase.php.
|
private |
Definition at line 244 of file ApiBase.php.
|
private |
Definition at line 246 of file ApiBase.php.
Referenced by getModuleName().
string ApiBase::$mModulePrefix |
Definition at line 246 of file ApiBase.php.
Referenced by getModulePrefix().
Definition at line 250 of file ApiBase.php.
Referenced by getModuleSourceInfo().
|
private |
Definition at line 248 of file ApiBase.php.
|
private |
Definition at line 247 of file ApiBase.php.
Referenced by getDB().
const ApiBase::ALL_DEFAULT_STRING = '*' |
Definition at line 222 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 238 of file ApiBase.php.
Referenced by ApiQueryLogEvents\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), ApiStructureTest\testDocumentationExists(), and ApiStructureTest\testParameterConsistency().
const ApiBase::LIMIT_BIG1 = 500 |
Fast query, standard limit.
Definition at line 225 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().
const ApiBase::LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit.
Definition at line 227 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryDeletedrevs\execute(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().
const ApiBase::LIMIT_SML1 = 50 |
Slow query, standard limit.
Definition at line 229 of file ApiBase.php.
Referenced by ApiQueryDeletedrevs\execute(), ApiQueryInfo\extractPageInfo(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), parseMultiValue(), and ApiQueryRevisionsBase\parseParameters().
const ApiBase::LIMIT_SML2 = 500 |
Slow query, apihighlimits limit.
Definition at line 231 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 183 of file ApiBase.php.
Referenced by 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 106 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 109 of file ApiBase.php.
Referenced by ApiQueryStashImageInfo\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiDelete\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiMove\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\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 205 of file ApiBase.php.
Referenced by ApiQueryUserInfo\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiParse\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 52 of file ApiBase.php.
Referenced by buildCommonApiParams(), buildProfileApiParam(), ApiQueryFileRepoInfo\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiTag\getAllowedParams(), ApiOptions\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiMove\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiMain\getAllowedParams(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), ApiFormatBase\getParameterFromSettings(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), TitleBlacklistHooks\onAPIGetAllowedParams(), ApiBaseTest\provideGetParameterFromSettings(), and ApiOpenSearchTest\testGetAllowedParams().
const ApiBase::PARAM_EXTRA_NAMESPACES = 18 |
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values.
Definition at line 189 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 128 of file ApiBase.php.
Referenced by ReCaptcha\APIGetAllowedParams(), SimpleCaptcha\APIGetAllowedParams(), buildCommonApiParams(), buildProfileApiParam(), ApiQueryReferences\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryCategoryInfo\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiPurge\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiLogin\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), getFinalParamDescription(), ApiAuthManagerHelper\getStandardParams(), and ApiStructureTest\testDocumentationExists().
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 135 of file ApiBase.php.
Referenced by ApiRollback\getAllowedParams(), ApiAMCreateAccount\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiEditPage\getAllowedParams(), and ApiStructureTest\testDocumentationExists().
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 145 of file ApiBase.php.
Referenced by ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and ApiStructureTest\testDocumentationExists().
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}.
Definition at line 160 of file ApiBase.php.
Referenced by buildProfileApiParam(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryInfo\getAllowedParams(), getFinalParamDescription(), and ApiStructureTest\testDocumentationExists().
const ApiBase::PARAM_ISMULTI = 1 |
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
titles)?
Definition at line 55 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiSpamBlacklist\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiTokens\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiImport\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiTag\getAllowedParams(), ApiOptions\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiBlock\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiMove\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_ISMULTI_LIMIT1 = 21 |
(integer) Maximum number of values, for normal users.
Must be used with PARAM_ISMULTI.
Definition at line 211 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
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 218 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_MAX = 3 |
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition at line 94 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
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 100 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_MIN = 5 |
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition at line 103 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_RANGE_ENFORCE = 9 |
(boolean) For PARAM_TYPE 'integer', enforce PARAM_MIN and PARAM_MAX?
Definition at line 121 of file ApiBase.php.
Referenced by ApiParamInfo\getModuleInfo(), and getParameterFromSettings().
const ApiBase::PARAM_REQUIRED = 8 |
(boolean) Is the parameter required?
Definition at line 115 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiSpamBlacklist\getAllowedParams(), ApiValidatePassword\getAllowedParams(), ApiCheckToken\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiProtect\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiMove\getAllowedParams(), ApiLogin\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), and ApiBaseTest\provideGetParameterFromSettings().
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 196 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 168 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 175 of file ApiBase.php.
Referenced by ApiPageSet\getAllowedParams(), 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 91 of file ApiBase.php.
Referenced by buildCommonApiParams(), buildProfileApiParam(), ApiValidatePassword\getAllowedParams(), ApiCheckToken\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiResetPassword\getAllowedParams(), ApiTokens\getAllowedParams(), ApiQueryAuthManagerInfo\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiMergeHistory\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiImport\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiOptions\getAllowedParams(), ApiProtect\getAllowedParams(), ApiTag\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiBlock\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiDelete\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiMove\getAllowedParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiLogin\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiUpload\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiMain\getAllowedParams(), ApiQueryGadgets\getExamplesMessages(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), TitleBlacklistHooks\onAPIGetAllowedParams(), and ApiStructureTest\testDocumentationExists().
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 152 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal().