MediaWiki REL1_31
|
This abstract class implements many basic API functions, and is the base of all API classes. More...
Inherits ContextSource.
Inherited by ApiAMCreateAccount, ApiBlock, ApiCSPReport, ApiCategoryTree, ApiChangeAuthenticationData, ApiCheckToken, ApiClearHasMsg, ApiClientLogin, ApiComparePages, ApiDelete, ApiDisabled, ApiEditPage, ApiEmailUser, ApiExpandTemplates, ApiFancyCaptchaReload, ApiFeedContributions, ApiFeedRecentChanges, ApiFeedWatchlist, ApiFileRevert, ApiFormatBase, ApiHelp, ApiImageRotate, ApiImport, ApiLinkAccount, ApiLogin, ApiLogout, ApiMain, ApiManageTags, ApiMergeHistory, ApiMove, ApiOATHValidate, 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(). | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
Public Attributes | |
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. | |
const | LIMIT_BIG1 = 500 |
Fast query, standard limit. | |
const | LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit. | |
const | LIMIT_SML1 = 50 |
Slow query, standard limit. | |
const | LIMIT_SML2 = 500 |
Slow query, apihighlimits limit. | |
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. | |
const | PARAM_ISMULTI = 1 |
(boolean) Accept multiple pipe-separated values for this parameter (e.g. | |
const | PARAM_TYPE = 2 |
(string|string[]) Either an array of allowed value strings, or a string type as described below. | |
const | PARAM_MAX = 3 |
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'. | |
const | PARAM_MAX2 = 4 |
(integer) Max value allowed for the parameter for users with the apihighlimits right, for PARAM_TYPE 'limit'. | |
const | PARAM_MIN = 5 |
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'. | |
const | PARAM_ALLOW_DUPLICATES = 6 |
(boolean) Allow the same value to be set more than once when PARAM_ISMULTI is true? | |
const | PARAM_DEPRECATED = 7 |
(boolean) Is the parameter deprecated (will show a warning)? | |
const | PARAM_REQUIRED = 8 |
(boolean) Is the parameter required? | |
const | PARAM_RANGE_ENFORCE = 9 |
(boolean) For PARAM_TYPE 'integer', enforce PARAM_MIN and PARAM_MAX? | |
const | PARAM_HELP_MSG = 10 |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. | |
const | PARAM_HELP_MSG_APPEND = 11 |
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this parameter. | |
const | PARAM_HELP_MSG_INFO = 12 |
(array) Specify additional information tags for the parameter. | |
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. | |
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(). | |
const | PARAM_SUBMODULE_MAP = 15 |
(string[]) When PARAM_TYPE is 'submodule', map parameter values to submodule paths. | |
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). | |
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. | |
const | PARAM_EXTRA_NAMESPACES = 18 |
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values. | |
const | PARAM_SENSITIVE = 19 |
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of the value of this field. | |
const | PARAM_DEPRECATED_VALUES = 20 |
(array) When PARAM_TYPE is an array, this indicates which of the values are deprecated. | |
const | PARAM_ISMULTI_LIMIT1 = 21 |
(integer) Maximum number of values, for normal users. | |
const | PARAM_ISMULTI_LIMIT2 = 22 |
(integer) Maximum number of values, for users with the apihighimits right. | |
const | PARAM_MAX_BYTES = 23 |
(integer) Maximum length of a string in bytes (in UTF-8 encoding). | |
const | PARAM_MAX_CHARS = 24 |
(integer) Maximum length of a string in characters (unicode codepoints). | |
Private Attributes | |
ApiMain | $mMainModule |
string | $mModuleName |
string | $mModulePrefix |
array null bool | $mModuleSource = false |
$mParamCache = [] | |
$mSlaveDB = null | |
Static Private Attributes | |
static array | $extensionInfo = null |
Maps extension paths to info arrays. | |
Deprecated | |
static | $messageMap |
profileIn () | |
profileOut () | |
safeProfileOut () | |
profileDBIn () | |
profileDBOut () | |
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. | |
getErrorFromStatus ( $status, &$extraData=null) | |
Get error (as code, string) from a Status object. | |
parseMsg ( $error) | |
Return the error message related to a certain array. | |
dieUsageMsg ( $error) | |
Output the error message related to a certain array. | |
dieUsageMsgOrDebug ( $error) | |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true. | |
getDescription () | |
Returns the description string for this module. | |
getParamDescription () | |
Returns an array of parameter descriptions. | |
getExamples () | |
Returns usage examples for this module. | |
useTransactionalTimeLimit () | |
Call wfTransactionalTimeLimit() if this request was POSTed. | |
getDescriptionMessage () | |
Return the description message. | |
parseMsgInternal ( $error) | |
Methods to implement | |
execute () | |
Evaluates the parameters, performs the requested query, and sets up the result. | |
getModuleManager () | |
Get the module manager, or null if this module has no sub-modules. | |
getCustomPrinter () | |
If the module may only be used with a certain format module, it should override this method to return an instance of that formatter. | |
getHelpUrls () | |
Return links to more detailed help pages about the module. | |
shouldCheckMaxlag () | |
Indicates if this module needs maxlag to be checked. | |
isReadMode () | |
Indicates whether this module requires read rights. | |
isWriteMode () | |
Indicates whether this module requires write mode. | |
mustBePosted () | |
Indicates whether this module must be called with a POST request. | |
isDeprecated () | |
Indicates whether this module is deprecated. | |
isInternal () | |
Indicates whether this module is "internal" Internal API modules are not (yet) intended for 3rd party use and may be unstable. | |
needsToken () | |
Returns the token type this module requires in order to execute. | |
getConditionalRequestData ( $condition) | |
Returns data for HTTP conditional request mechanisms. | |
getExamplesMessages () | |
Returns usage examples for this module. | |
getAllowedParams () | |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed. | |
getWebUITokenSalt (array $params) | |
Fetch the salt used in the Web UI corresponding to this module. | |
Data access methods | |
getModuleName () | |
Get the name of the module being executed by this instance. | |
getModulePrefix () | |
Get parameter prefix (usually two letters or an empty string). | |
getMain () | |
Get the main module. | |
isMain () | |
Returns true if this module is the main module ($this === $this->mMainModule), false otherwise. | |
getParent () | |
Get the parent of this module. | |
lacksSameOriginSecurity () | |
Returns true if the current request breaks the same-origin policy. | |
getModulePath () | |
Get the path to this module. | |
getModuleFromPath ( $path) | |
Get a module from its module path. | |
getResult () | |
Get the result object. | |
getErrorFormatter () | |
Get the error formatter. | |
getContinuationManager () | |
Get the continuation manager. | |
setContinuationManager (ApiContinuationManager $manager=null) | |
Set the continuation manager. | |
getDB () | |
Gets a default replica DB connection object. | |
Parameter handling | |
dynamicParameterDocumentation () | |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams(). | |
encodeParamName ( $paramName) | |
This method mangles parameter name based on the prefix supplied to the constructor. | |
extractRequestParams ( $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. | |
requireOnlyOneParameter ( $params, $required) | |
Die if none or more than one of a certain set of parameters is set and not false. | |
requireMaxOneParameter ( $params, $required) | |
Die if more than one of a certain set of parameters is set and not false. | |
requireAtLeastOneParameter ( $params, $required) | |
Die if none of a certain set of parameters is set and not false. | |
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. | |
getTitleOrPageId ( $params, $load=false) | |
Get a WikiPage object from a title or pageid param, if possible. | |
getTitleFromTitleOrPageId ( $params) | |
Get a Title object from a title or pageid param, if possible. | |
validateToken ( $token, array $params) | |
Validate the supplied token. | |
getParameter ( $paramName, $parseLimit=true) | |
Get a value for the given parameter. | |
getWatchlistValue ( $watchlist, $titleObj, $userOption=null) | |
Return true if we're to watch the page, false if not, null if no change. | |
getParameterFromSettings ( $paramName, $paramSettings, $parseLimit) | |
Using the settings determine the value for the given parameter. | |
handleParamNormalization ( $paramName, $value, $rawValue) | |
Handle when a parameter was Unicode-normalized. | |
explodeMultiValue ( $value, $limit) | |
Split a multi-valued parameter string, like explode() | |
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. | |
validateLimit ( $paramName, &$value, $min, $max, $botMax=null, $enforceLimits=false) | |
Validate the value against the minimum and user/bot maximum limits. | |
validateTimestamp ( $value, $encParamName) | |
Validate and normalize parameters of type 'timestamp'. | |
parameterNotEmpty ( $x) | |
Callback function used in requireOnlyOneParameter to check whether required parameters are set. | |
validateUser ( $value, $encParamName) | |
Validate and normalize parameters of type 'user'. | |
Utility methods | |
getWatchlistUser ( $params) | |
Gets the user for whom to get the watchlist. | |
errorArrayToStatus (array $errors, User $user=null) | |
Turn an array of message keys or key+param arrays into a Status. | |
setWatch ( $watch, $titleObj, $userOption=null) | |
Set a watch (or unwatch) based the based on a watchlist parameter. | |
static | truncateArray (&$arr, $limit) |
Truncate an array to a certain length. | |
static | makeMessage ( $msg, IContextSource $context, array $params=null) |
Create a Message from a string or array. | |
static | escapeWikiText ( $v) |
A subset of wfEscapeWikiText for BC texts. | |
Warning and error reporting | |
addWarning ( $msg, $code=null, $data=null) | |
Add a warning for this module. | |
addDeprecation ( $msg, $feature, $data=[]) | |
Add a deprecation warning for this module. | |
addError ( $msg, $code=null, $data=null) | |
Add an error for this module without aborting. | |
addMessagesFromStatus (StatusValue $status, $types=[ 'warning', 'error']) | |
Add warnings and/or errors from a Status. | |
dieWithError ( $msg, $code=null, $data=null, $httpCode=null) | |
Abort execution with an error. | |
dieWithException ( $exception, array $options=[]) | |
Abort execution with an error derived from an exception. | |
dieBlocked (Block $block) | |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info. | |
dieStatus (StatusValue $status) | |
Throw an ApiUsageException based on the Status object. | |
dieReadOnly () | |
Helper function for readonly errors. | |
checkUserRightsAny ( $rights, $user=null) | |
Helper function for permission-denied errors. | |
checkTitleUserPermissions (Title $title, $actions, $user=null) | |
Helper function for permission-denied errors. | |
dieWithErrorOrDebug ( $msg, $code=null, $data=null, $httpCode=null) | |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true. | |
logFeatureUsage ( $feature) | |
Write logging information for API features to a debug log, for usage analysis. | |
dieContinueUsageIf ( $condition) | |
Die with the 'badcontinue' error. | |
warnOrDie (ApiMessage $msg, $enforceLimits=false) | |
Adds a warning to the output, else dies. | |
static | dieDebug ( $method, $message) |
Internal code errors should be reported with this method. | |
Help message generation | |
getFinalSummary () | |
Get final module summary. | |
getFinalDescription () | |
Get final module description, after hooks have had a chance to tweak it as needed. | |
getFinalParams ( $flags=0) | |
Get final list of parameters, after hooks have had a chance to tweak it as needed. | |
getFinalParamDescription () | |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed. | |
modifyHelp (array &$help, array $options, array &$tocData) | |
Called from ApiHelp before the pieces are joined together and returned. | |
getSummaryMessage () | |
Return the summary message. | |
getExtendedDescription () | |
Return the extended help text message. | |
getHelpFlags () | |
Generates the list of flags for the help screen and for action=paraminfo. | |
getModuleSourceInfo () | |
Returns information about the source of this module, if known. | |
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 37 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 266 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 1833 of file ApiBase.php.
References addWarning(), array(), getMain(), logFeatureUsage(), and ContextSource\msg().
Referenced by ApiExpandTemplates\execute(), ApiLogin\execute(), ApiQueryDeletedrevs\execute(), ApiTokens\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 1866 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 1878 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 1819 of file ApiBase.php.
References $code, getErrorFormatter(), and getModulePath().
Referenced by addDeprecation(), ApiFormatXml\addXslt(), dieWithErrorOrDebug(), ApiCheckToken\execute(), ApiExpandTemplates\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiParse\execute(), ApiPurge\execute(), ApiQueryDisabled\execute(), ApiQueryTokens\execute(), ApiQueryUsers\execute(), ApiTokens\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(), ApiQueryCategories\run(), ApiQueryImages\run(), ApiQueryLinks\run(), ApiQueryAllDeletedRevisions\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 2024 of file ApiBase.php.
References dieStatus(), errorArrayToStatus(), and ContextSource\getUser().
Referenced by ApiDelete\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiParse\execute(), ApiProtect\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 2006 of file ApiBase.php.
References array(), dieWithError(), ContextSource\getUser(), and ContextSource\msg().
Referenced by ApiOATHValidate\execute(), ApiQueryOATH\execute(), ApiBlock\execute(), ApiOptions\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiRevisionDelete\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiTag\execute(), ApiWatch\execute(), getWatchlistUser(), ApiQueryAllDeletedRevisions\run(), and ApiQueryDeletedRevisions\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 1935 of file ApiBase.php.
References dieWithError(), ApiQueryUserInfo\getBlockInfo(), Block\getType(), and Block\TYPE_AUTO.
Referenced by ApiUpload\checkPermissions(), ApiPurge\execute(), ApiRevisionDelete\execute(), ApiTag\execute(), ApiUndelete\execute(), and ApiUserrights\execute().
|
protected |
Die with the 'badcontinue' error.
This call is common enough to make it into the base method.
bool | $condition | Will only die if this value is true |
ApiUsageException |
Definition at line 2066 of file ApiBase.php.
References dieWithError().
Referenced by ApiQueryReferences\execute(), ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryImageInfo\execute(), ApiQueryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryPageProps\execute(), ApiQueryContributions\execute(), ApiQueryContributions\prepareQuery(), ApiQueryAllCategories\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryAllPages\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryDuplicateFiles\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryLinks\run(), ApiQueryPagesWithProp\run(), ApiQueryProtectedTitles\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryWatchlist\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryDeletedRevisions\run(), and ApiQueryRevisions\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 2078 of file ApiBase.php.
Referenced by ApiQueryAllLinks\__construct(), ApiQueryLinks\__construct(), ApiQueryBase\addJoinConds(), ApiQueryBase\addTables(), ApiQuerySiteinfo\appendInterwikiMap(), ApiFormatFeedWrapper\execute(), ApiFormatJson\execute(), ApiFormatPhp\execute(), ApiFormatRaw\execute(), ApiLogin\execute(), ApiQueryAllUsers\execute(), ApiQuerySiteinfo\execute(), ApiUpload\execute(), getContinuationManager(), ApiOpenSearch\getCustomPrinter(), getErrorFormatter(), getFinalParamDescription(), ApiFormatRaw\getMimeType(), getParameterFromSettings(), getResult(), ApiPageSet\initFromQueryResult(), ApiFormatFeedWrapper\initPrinter(), ApiQuery\instantiateModules(), lacksSameOriginSecurity(), ApiOpenSearch\populateResult(), ApiQueryRecentChanges\run(), ApiQueryWatchlist\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\run(), setContinuationManager(), and ApiQueryGeneratorBase\setGeneratorMode().
ApiBase::dieReadOnly | ( | ) |
Helper function for readonly errors.
ApiUsageException | always |
Definition at line 1990 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 1960 of file ApiBase.php.
Referenced by ApiUpload\checkPermissions(), checkTitleUserPermissions(), ApiUpload\dieRecoverableError(), ApiUpload\dieStatusWithCode(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetPageLanguage\execute(), ApiTag\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), 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 2672 of file ApiBase.php.
References dieWithError(), and wfDeprecated().
Referenced by ApiCategoryTree\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 2932 of file ApiBase.php.
References dieWithError(), parseMsgInternal(), and wfDeprecated().
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 2945 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 1895 of file ApiBase.php.
References $code, and ApiUsageException\newWithMessage().
Referenced by ApiQuerySiteinfo\appendDbReplLagInfo(), 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(), ApiCategoryTree\execute(), ApiQueryReferences\execute(), ApiOATHValidate\execute(), ApiQueryOATH\execute(), ApiQueryTitleBlacklist\execute(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiDelete\execute(), ApiDisabled\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiFormatPhp\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogout\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOpenSearchFormatJson\execute(), ApiOptions\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiQueryAllMessages\execute(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryStashImageInfo\execute(), ApiQueryContributions\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiQueryAllImages\executeGenerator(), ApiQueryAllPages\executeGenerator(), 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(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryAllPages\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryQueryPage\run(), ApiQueryRecentChanges\run(), ApiQuerySearch\run(), ApiQueryWatchlist\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryRevisions\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 2049 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 1907 of file ApiBase.php.
References $options, dieWithError(), and getErrorFormatter().
Referenced by ApiEditPage\execute(), ApiImport\execute(), ApiParse\execute(), ApiQueryStashImageInfo\execute(), and ApiComparePages\getDiffContent().
ApiBase::dynamicParameterDocumentation | ( | ) |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams().
Reimplemented in ApiAMCreateAccount, ApiChangeAuthenticationData, ApiClientLogin, and ApiLinkAccount.
Definition at line 719 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 730 of file ApiBase.php.
References $name.
Referenced by ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiQueryAllMessages\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryContributions\execute(), ApiSetNotificationTimestamp\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiPageSet\executeInternal(), getParameterFromSettings(), handleParamNormalization(), ApiQueryBlocks\prepareUsername(), requireAtLeastOneParameter(), requireMaxOneParameter(), requireOnlyOneParameter(), requirePostedParameters(), and validateLimit().
ApiBase::errorArrayToStatus | ( | array | $errors, |
User | $user = null ) |
Turn an array of message keys or key+param arrays into a Status.
array | $errors | |
User | null | $user |
Definition at line 1766 of file ApiBase.php.
References ApiMessage\create(), ApiQueryUserInfo\getBlockInfo(), and ContextSource\getUser().
Referenced by checkTitleUserPermissions(), ApiBlock\execute(), ApiImageRotate\execute(), ApiPatrol\execute(), ApiRollback\execute(), ApiUnblock\execute(), and ApiMove\moveSubpages().
|
staticprivate |
A subset of wfEscapeWikiText for BC texts.
string | array | $v |
Definition at line 1717 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 ApiCategoryTree, ApiQueryReferences, ApiFancyCaptchaReload, ApiQueryGadgetCategories, ApiQueryGadgets, ApiOATHValidate, ApiQueryOATH, ApiSpamBlacklist, ApiQueryTitleBlacklist, ApiAMCreateAccount, ApiBlock, ApiChangeAuthenticationData, ApiCheckToken, ApiClearHasMsg, ApiClientLogin, ApiComparePages, ApiCSPReport, ApiDelete, ApiDisabled, ApiEditPage, ApiEmailUser, ApiExpandTemplates, ApiFeedContributions, ApiFeedRecentChanges, ApiFeedWatchlist, ApiFileRevert, ApiFormatFeedWrapper, ApiFormatJson, ApiFormatNone, ApiFormatPhp, ApiFormatRaw, ApiFormatXml, ApiHelp, ApiImageRotate, ApiImport, ApiLinkAccount, ApiLogin, ApiLogout, ApiMain, ApiManageTags, ApiMergeHistory, ApiMove, ApiOpenSearch, ApiOpenSearchFormatJson, ApiOptions, ApiPageSet, ApiParamInfo, ApiParse, ApiPatrol, ApiProtect, ApiPurge, ApiQuery, ApiQueryAllCategories, ApiQueryAllImages, ApiQueryAllLinks, ApiQueryAllMessages, ApiQueryAllPages, ApiQueryAllUsers, ApiQueryAuthManagerInfo, ApiQueryBacklinks, ApiQueryBacklinksprop, ApiQueryBlocks, ApiQueryCategories, ApiQueryCategoryInfo, ApiQueryCategoryMembers, ApiQueryContributors, ApiQueryDeletedrevs, ApiQueryDisabled, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryExtLinksUsage, ApiQueryFilearchive, ApiQueryFileRepoInfo, ApiQueryImageInfo, ApiQueryImages, ApiQueryInfo, ApiQueryIWBacklinks, ApiQueryIWLinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryLinks, ApiQueryLogEvents, ApiQueryMyStashedFiles, ApiQueryPagePropNames, ApiQueryPageProps, ApiQueryPagesWithProp, ApiQueryPrefixSearch, ApiQueryProtectedTitles, ApiQueryQueryPage, ApiQueryRandom, ApiQueryRecentChanges, ApiQueryRevisionsBase, ApiQuerySearch, ApiQuerySiteinfo, ApiQueryStashImageInfo, ApiQueryTags, ApiQueryTokens, ApiQueryContributions, ApiQueryUserInfo, ApiQueryUsers, ApiQueryWatchlist, ApiQueryWatchlistRaw, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiRsd, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiStashEdit, ApiTag, ApiTokens, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, ApiWatch, MockApi, and MockApiQueryBase.
|
protected |
Split a multi-valued parameter string, like explode()
string | $value | |
int | $limit |
Definition at line 1376 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 749 of file ApiBase.php.
References $params, getFinalParams(), and getParameterFromSettings().
Referenced by ApiPageSet\__construct(), ApiAuthManagerHelper\__construct(), ApiContinuationManager\__construct(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendLanguages(), ApiCategoryTree\execute(), ApiQueryReferences\execute(), ApiQueryGadgetCategories\execute(), ApiQueryGadgets\execute(), ApiOATHValidate\execute(), ApiQueryOATH\execute(), ApiSpamBlacklist\execute(), ApiQueryTitleBlacklist\execute(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiCheckToken\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiFileRevert\execute(), ApiFormatJson\execute(), ApiFormatPhp\execute(), ApiFormatXml\execute(), ApiHelp\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogin\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOpenSearch\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQuery\execute(), ApiQueryAllMessages\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryCategoryInfo\execute(), ApiQueryContributors\execute(), ApiQueryDeletedrevs\execute(), ApiQueryExternalLinks\execute(), ApiQueryFilearchive\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryImageInfo\execute(), ApiQueryInfo\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryPageProps\execute(), ApiQuerySiteinfo\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiQueryContributions\execute(), ApiQueryUserInfo\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiTokens\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiCategoryTree\getConditionalRequestData(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getFormat(), ApiFormatJson\getMimeType(), ApiComparePages\guessTitleAndModel(), ApiQuery\isReadMode(), ApiQueryAllCategories\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryAllPages\run(), ApiQueryCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryDuplicateFiles\run(), ApiQueryExtLinksUsage\run(), ApiQueryImages\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryLinks\run(), ApiQueryPagesWithProp\run(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryQueryPage\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQuerySearch\run(), ApiQueryWatchlist\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\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 ApiCategoryTree, ApiQueryReferences, ApiFancyCaptchaReload, ApiQueryGadgetCategories, ApiQueryGadgets, ApiOATHValidate, ApiQueryOATH, ApiSpamBlacklist, ApiQueryTitleBlacklist, ApiAMCreateAccount, ApiBlock, ApiChangeAuthenticationData, ApiCheckToken, ApiClientLogin, ApiComparePages, ApiCSPReport, ApiDelete, ApiEditPage, ApiEmailUser, ApiExpandTemplates, ApiFeedContributions, ApiFeedRecentChanges, ApiFileRevert, ApiFormatBase, ApiFormatJson, ApiFormatPhp, ApiFormatXml, ApiHelp, ApiImport, ApiLinkAccount, ApiLogin, ApiMain, ApiManageTags, ApiMergeHistory, ApiMove, ApiOpenSearch, ApiOptions, ApiParamInfo, ApiParse, ApiPatrol, ApiProtect, ApiQueryAllCategories, ApiQueryAllDeletedRevisions, ApiQueryAllImages, ApiQueryAllLinks, ApiQueryAllMessages, ApiQueryAllPages, ApiQueryAllRevisions, ApiQueryAllUsers, ApiQueryAuthManagerInfo, ApiQueryBacklinks, ApiQueryBacklinksprop, ApiQueryBlocks, ApiQueryCategories, ApiQueryCategoryInfo, ApiQueryCategoryMembers, ApiQueryContributors, ApiQueryDeletedRevisions, ApiQueryDeletedrevs, ApiQueryDisabled, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryExtLinksUsage, ApiQueryFilearchive, ApiQueryFileRepoInfo, ApiQueryImageInfo, ApiQueryImages, ApiQueryInfo, ApiQueryIWBacklinks, ApiQueryIWLinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryLinks, ApiQueryMyStashedFiles, ApiQueryPagePropNames, ApiQueryPageProps, ApiQueryPagesWithProp, ApiQueryPrefixSearch, ApiQueryProtectedTitles, ApiQueryQueryPage, ApiQueryRandom, ApiQueryRecentChanges, ApiQueryRevisions, ApiQueryRevisionsBase, ApiQuerySearch, ApiQuerySiteinfo, ApiQueryStashImageInfo, ApiQueryTags, ApiQueryTokens, ApiQueryContributions, ApiQueryUserInfo, ApiQueryUsers, ApiQueryWatchlist, ApiQueryWatchlistRaw, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiSetPageLanguage, ApiStashEdit, ApiTag, ApiTokens, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, and MockApi.
Definition at line 395 of file ApiBase.php.
Referenced by getFinalParams().
ApiBase::getConditionalRequestData | ( | $condition | ) |
Returns data for HTTP conditional request mechanisms.
string | $condition | Condition being queried:
|
Reimplemented in ApiCategoryTree.
Definition at line 506 of file ApiBase.php.
ApiBase::getContinuationManager | ( | ) |
Get the continuation manager.
Reimplemented in ApiMain.
Definition at line 681 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryAllRevisions\run(), ApiQueryBase\setContinueEnumParameter(), and ApiQueryGeneratorBase\setContinueEnumParameter().
ApiBase::getCustomPrinter | ( | ) |
If the module may only be used with a certain format module, it should override this method to return an instance of that formatter.
A value of null means the default format will be used.
Reimplemented in ApiFeedContributions, ApiFeedRecentChanges, ApiFeedWatchlist, ApiHelp, ApiOpenSearch, ApiQuery, and ApiRsd.
Definition at line 317 of file ApiBase.php.
|
protected |
Gets a default replica DB connection object.
Reimplemented in ApiPageSet, ApiQueryAllImages, and ApiQueryBase.
Definition at line 669 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 2562 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 2958 of file ApiBase.php.
Referenced by getFinalDescription(), and getFinalSummary().
ApiBase::getErrorFormatter | ( | ) |
Get the error formatter.
Reimplemented in ApiMain.
Definition at line 655 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), dieWithException(), ApiEmailUser\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiManageTags\execute(), ApiMove\execute(), ApiQueryUsers\execute(), ApiValidatePassword\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 2692 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 2598 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 ApiQueryReferences, ApiFancyCaptchaReload, ApiQueryGadgetCategories, ApiQueryGadgets, ApiOATHValidate, ApiQueryOATH, ApiSpamBlacklist, ApiQueryTitleBlacklist, ApiAMCreateAccount, ApiBlock, ApiChangeAuthenticationData, ApiCheckToken, ApiClearHasMsg, ApiClientLogin, ApiComparePages, ApiDelete, ApiEditPage, ApiEmailUser, ApiExpandTemplates, ApiFeedContributions, ApiFeedRecentChanges, ApiFeedWatchlist, ApiFileRevert, ApiFormatBase, ApiHelp, ApiImageRotate, ApiImport, ApiLinkAccount, ApiLogin, ApiLogout, ApiMain, ApiManageTags, ApiMergeHistory, ApiMove, ApiOpenSearch, ApiOptions, ApiParamInfo, ApiParse, ApiPatrol, ApiProtect, ApiPurge, ApiQuery, ApiQueryAllCategories, ApiQueryAllDeletedRevisions, ApiQueryAllImages, ApiQueryAllLinks, ApiQueryAllMessages, ApiQueryAllPages, ApiQueryAllRevisions, ApiQueryAllUsers, ApiQueryAuthManagerInfo, ApiQueryBacklinks, ApiQueryBacklinksprop, ApiQueryBlocks, ApiQueryCategories, ApiQueryCategoryInfo, ApiQueryCategoryMembers, ApiQueryContributors, ApiQueryDeletedRevisions, ApiQueryDeletedrevs, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryExtLinksUsage, ApiQueryFilearchive, ApiQueryFileRepoInfo, ApiQueryImageInfo, ApiQueryImages, ApiQueryInfo, ApiQueryIWBacklinks, ApiQueryIWLinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryLinks, ApiQueryLogEvents, ApiQueryMyStashedFiles, ApiQueryPagePropNames, ApiQueryPageProps, ApiQueryPagesWithProp, ApiQueryPrefixSearch, ApiQueryProtectedTitles, ApiQueryQueryPage, ApiQueryRandom, ApiQueryRecentChanges, ApiQueryRevisions, ApiQuerySearch, ApiQuerySiteinfo, ApiQueryStashImageInfo, ApiQueryTags, ApiQueryTokens, ApiQueryContributions, ApiQueryUserInfo, ApiQueryUsers, ApiQueryWatchlist, ApiQueryWatchlistRaw, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiRsd, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiTag, ApiTokens, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, and ApiWatch.
Definition at line 332 of file ApiBase.php.
References $ret, 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, ApiLogin, ApiQueryDisabled, ApiResetPassword, and ApiSetPageLanguage.
Definition at line 2127 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 ApiAMCreateAccount, ApiClientLogin, and ApiLinkAccount.
Definition at line 2171 of file ApiBase.php.
References escapeWikiText(), ContextSource\getContext(), getDescription(), getDescriptionMessage(), getExtendedDescription(), getModuleName(), getModulePath(), getModulePrefix(), getSummaryMessage(), makeMessage(), ContextSource\msg(), string, and wfDeprecated().
ApiBase::getFinalParamDescription | ( | ) |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed.
Definition at line 2257 of file ApiBase.php.
References $line, $params, $value, 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, and PARAM_SUBMODULE_MAP.
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 2225 of file ApiBase.php.
References $params, getAllowedParams(), and needsToken().
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 2144 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 2421 of file ApiBase.php.
References isDeprecated(), isInternal(), isReadMode(), isWriteMode(), and mustBePosted().
ApiBase::getHelpUrls | ( | ) |
Return links to more detailed help pages about the module.
Reimplemented in ApiSpamBlacklist, ApiAMCreateAccount, ApiBlock, ApiChangeAuthenticationData, ApiClearHasMsg, ApiClientLogin, ApiDelete, ApiEditPage, ApiEmailUser, ApiExpandTemplates, ApiFeedWatchlist, ApiFormatBase, ApiHelp, ApiImport, ApiLinkAccount, ApiLogin, ApiLogout, ApiManageTags, ApiMergeHistory, ApiMove, ApiOpenSearch, ApiOptions, ApiParamInfo, ApiParse, ApiPatrol, ApiProtect, ApiPurge, ApiQuery, ApiQueryAllCategories, ApiQueryAllDeletedRevisions, ApiQueryAllImages, ApiQueryAllLinks, ApiQueryAllMessages, ApiQueryAllPages, ApiQueryAllRevisions, ApiQueryAllUsers, ApiQueryAuthManagerInfo, ApiQueryBacklinks, ApiQueryBacklinksprop, ApiQueryBlocks, ApiQueryCategories, ApiQueryCategoryInfo, ApiQueryCategoryMembers, ApiQueryContributors, ApiQueryDeletedRevisions, ApiQueryDeletedrevs, ApiQueryDuplicateFiles, ApiQueryExternalLinks, ApiQueryExtLinksUsage, ApiQueryFilearchive, ApiQueryFileRepoInfo, ApiQueryImageInfo, ApiQueryImages, ApiQueryInfo, ApiQueryIWBacklinks, ApiQueryIWLinks, ApiQueryLangBacklinks, ApiQueryLangLinks, ApiQueryLinks, ApiQueryLogEvents, ApiQueryMyStashedFiles, ApiQueryPagePropNames, ApiQueryPageProps, ApiQueryPagesWithProp, ApiQueryPrefixSearch, ApiQueryProtectedTitles, ApiQueryQueryPage, ApiQueryRandom, ApiQueryRecentChanges, ApiQueryRevisions, ApiQuerySearch, ApiQuerySiteinfo, ApiQueryStashImageInfo, ApiQueryTags, ApiQueryTokens, ApiQueryContributions, ApiQueryUserInfo, ApiQueryUsers, ApiQueryWatchlist, ApiQueryWatchlistRaw, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiTag, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, and ApiWatch.
Definition at line 379 of file ApiBase.php.
ApiBase::getMain | ( | ) |
Get the main module.
Definition at line 537 of file ApiBase.php.
References $mMainModule.
Referenced by ApiContinuationManager\__construct(), ApiFormatBase\__construct(), ApiFormatJson\__construct(), addDeprecation(), ApiFormatBase\closePrinter(), ApiCategoryTree\execute(), ApiQueryGadgetCategories\execute(), ApiQueryGadgets\execute(), ApiComparePages\execute(), ApiEditPage\execute(), ApiExpandTemplates\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiHelp\execute(), ApiOpenSearch\execute(), ApiParamInfo\execute(), ApiParse\execute(), ApiQuery\execute(), ApiQueryDeletedrevs\execute(), ApiUpload\execute(), ApiPageSet\executeInternal(), ApiQueryInfo\extractPageInfo(), ApiParamInfo\getAllowedParams(), ApiUpload\getChunkResult(), getContinuationManager(), ApiQueryUserInfo\getCurrentUserInfo(), ApiFeedContributions\getCustomPrinter(), ApiFeedRecentChanges\getCustomPrinter(), ApiFeedWatchlist\getCustomPrinter(), ApiHelp\getCustomPrinter(), ApiOpenSearch\getCustomPrinter(), ApiQuery\getCustomPrinter(), ApiRsd\getCustomPrinter(), getErrorFormatter(), ApiPageSet\getGenerators(), getModuleFromPath(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), getParent(), getResult(), ApiFeedWatchlist\getWatchlistModule(), ApiFormatBase\initPrinter(), ApiFormatRaw\initPrinter(), lacksSameOriginSecurity(), logFeatureUsage(), ApiQueryRevisionsBase\parseParameters(), requirePostedParameters(), ApiQueryRandom\run(), ApiQuerySearch\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 603 of file ApiBase.php.
References dieWithError(), getMain(), and wfEscapeWikiText().
Referenced by ApiHelp\execute(), ApiParamInfo\execute(), getFinalParamDescription(), and ApiParamInfo\getModuleInfo().
ApiBase::getModuleManager | ( | ) |
Get the module manager, or null if this module has no sub-modules.
Reimplemented in ApiMain, and ApiQuery.
Definition at line 304 of file ApiBase.php.
Referenced by ApiFormatBase\closePrinter(), 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 521 of file ApiBase.php.
References $mModuleName.
Referenced by ApiContinuationManager\__construct(), ApiContinuationManager\addContinueParam(), ApiContinuationManager\addGeneratorContinueParam(), ApiContinuationManager\addGeneratorNonContinueParam(), ApiQuerySearch\addInterwikiResults(), ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryGadgets\applyList(), ApiCategoryTree\execute(), ApiFancyCaptchaReload\execute(), ApiOATHValidate\execute(), ApiQueryOATH\execute(), ApiBlock\execute(), ApiCheckToken\execute(), ApiClearHasMsg\execute(), ApiComparePages\execute(), ApiCSPReport\execute(), ApiDelete\execute(), ApiDisabled\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFileRevert\execute(), ApiHelp\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQueryAllMessages\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryDeletedrevs\execute(), ApiQueryDisabled\execute(), ApiQueryFilearchive\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiQueryContributions\execute(), ApiQueryUserInfo\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiTokens\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiQueryBacklinksprop\getAllowedParams(), ApiFormatBase\getExamplesMessages(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiQueryAllLinks\getHelpUrls(), ApiQueryBacklinksprop\getHelpUrls(), ApiQueryGadgetCategories\getList(), getModulePath(), MockApi\getModulePath(), getParameterFromSettings(), ApiAuthManagerHelper\logAuthenticationResult(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllCategories\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryAllPages\run(), ApiQueryCategoryMembers\run(), ApiQueryExtLinksUsage\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryPagesWithProp\run(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryQueryPage\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQuerySearch\run(), ApiQueryWatchlist\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryBacklinksprop\run(), ApiQueryRandom\runQuery(), and ApiUpload\selectUploadModule().
ApiBase::getModulePath | ( | ) |
Get the path to this module.
Reimplemented in MockApi, and MockApiQueryBase.
Definition at line 585 of file ApiBase.php.
References getModuleName(), getParent(), and isMain().
Referenced by addError(), addMessagesFromStatus(), addWarning(), ApiQueryAllLinks\getExamplesMessages(), ApiQueryBacklinksprop\getExamplesMessages(), ApiQueryLinks\getExamplesMessages(), ApiRemoveAuthenticationData\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiHelp\getHelp(), and setWarning().
ApiBase::getModulePrefix | ( | ) |
Get parameter prefix (usually two letters or an empty string).
Definition at line 529 of file ApiBase.php.
References $mModulePrefix.
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQueryDeletedrevs\execute(), ApiQueryStashImageInfo\execute(), ApiQueryUserInfo\getAllowedParams(), ApiQueryAllLinks\getExamplesMessages(), ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiQueryImageInfo\mergeThumbParams(), ApiQueryRevisionsBase\parseParameters(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryAllDeletedRevisions\run(), and ApiQueryRevisions\run().
|
protected |
Returns information about the source of this module, if known.
Returned array is an array with the following keys:
Definition at line 2454 of file ApiBase.php.
References $ext, $IP, $mModuleSource, $path, ContextSource\getConfig(), and ExtensionRegistry\getInstance().
|
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 2578 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 773 of file ApiBase.php.
References getFinalParams(), and getParameterFromSettings().
Referenced by ApiFormatRaw\__construct(), ApiMain\addRequestedFields(), ApiQuerySiteinfo\appendSkins(), ApiCSPReport\execute(), ApiFeedRecentChanges\execute(), ApiOpenSearch\getCustomPrinter(), ApiQuery\getCustomPrinter(), ApiCSPReport\getFlags(), ApiMain\handleCORS(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), ApiQueryRevisions\run(), ApiMain\sendCacheHeaders(), and ApiMain\setCacheMode().
|
protected |
Using the settings determine the value for the given parameter.
string | $paramName | Parameter name |
array | mixed | $paramSettings | Default value or an array of settings using PARAM_* constants. |
bool | $parseLimit | Whether to parse and validate 'limit' parameters |
Reimplemented in ApiFormatBase.
Definition at line 1032 of file ApiBase.php.
References $request, $type, $value, addDeprecation(), ALL_DEFAULT_STRING, ChangeTags\canAddTagsAccompanyingChange(), dieDebug(), dieStatus(), dieWithError(), encodeParamName(), getMain(), getModuleManager(), getModuleName(), getResult(), handleParamNormalization(), PARAM_ALL, PARAM_ALLOW_DUPLICATES, PARAM_DEPRECATED, PARAM_DEPRECATED_VALUES, PARAM_DFLT, PARAM_ISMULTI, PARAM_ISMULTI_LIMIT1, PARAM_ISMULTI_LIMIT2, PARAM_MAX, PARAM_MAX2, PARAM_MIN, PARAM_RANGE_ENFORCE, PARAM_REQUIRED, PARAM_TYPE, parseMultiValue(), validateLimit(), validateTimestamp(), and validateUser().
Referenced by extractRequestParams(), and getParameter().
ApiBase::getParent | ( | ) |
Get the parent of this module.
Reimplemented in ApiQueryBase.
Definition at line 555 of file ApiBase.php.
References getMain(), and isMain().
Referenced by getModulePath().
ApiBase::getResult | ( | ) |
Get the result object.
Reimplemented in ApiMain.
Definition at line 641 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiQueryBase\addPageSubItem(), ApiQueryBase\addPageSubItems(), ApiQuerySiteinfo\appendDbReplLagInfo(), ApiQuerySiteinfo\appendDefaultOptions(), ApiQuerySiteinfo\appendExtensions(), ApiQuerySiteinfo\appendExtensionTags(), ApiQuerySiteinfo\appendFileExtensions(), ApiQuerySiteinfo\appendFunctionHooks(), ApiQuerySiteinfo\appendGeneralInfo(), ApiQuerySiteinfo\appendInstalledLibraries(), ApiQuerySiteinfo\appendInterwikiMap(), ApiQuerySiteinfo\appendLanguages(), ApiQuerySiteinfo\appendLanguageVariants(), ApiQuerySiteinfo\appendMagicWords(), ApiQuerySiteinfo\appendNamespaceAliases(), ApiQuerySiteinfo\appendNamespaces(), ApiQuerySiteinfo\appendProtocols(), ApiQuerySiteinfo\appendRestrictions(), ApiQuerySiteinfo\appendRightsInfo(), ApiQuerySiteinfo\appendSkins(), ApiQuerySiteinfo\appendSpecialPageAliases(), ApiQuerySiteinfo\appendStatistics(), ApiQuerySiteinfo\appendSubscribedHooks(), ApiQuerySiteinfo\appendUploadDialog(), ApiQuerySiteinfo\appendUserGroups(), ApiQuerySiteinfo\appendVariables(), ApiQueryGadgets\applyList(), ApiFormatBase\closePrinter(), ApiFormatRaw\closePrinter(), ApiCategoryTree\execute(), ApiFancyCaptchaReload\execute(), ApiOATHValidate\execute(), ApiQueryOATH\execute(), ApiSpamBlacklist\execute(), ApiQueryTitleBlacklist\execute(), ApiAMCreateAccount\execute(), ApiBlock\execute(), ApiChangeAuthenticationData\execute(), ApiCheckToken\execute(), ApiClearHasMsg\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiCSPReport\execute(), ApiDelete\execute(), ApiEditPage\execute(), ApiEmailUser\execute(), ApiExpandTemplates\execute(), ApiFeedContributions\execute(), ApiFeedRecentChanges\execute(), ApiFeedWatchlist\execute(), ApiFileRevert\execute(), ApiFormatFeedWrapper\execute(), ApiFormatJson\execute(), ApiFormatPhp\execute(), ApiFormatRaw\execute(), ApiFormatXml\execute(), ApiHelp\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiLinkAccount\execute(), ApiLogin\execute(), ApiManageTags\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiOpenSearchFormatJson\execute(), ApiOptions\execute(), ApiParamInfo\execute(), ApiParse\execute(), ApiPatrol\execute(), ApiProtect\execute(), ApiPurge\execute(), ApiQuery\execute(), ApiQueryAllMessages\execute(), ApiQueryAllUsers\execute(), ApiQueryAuthManagerInfo\execute(), ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), ApiQueryFileRepoInfo\execute(), ApiQueryImageInfo\execute(), ApiQueryInfo\execute(), ApiQueryLogEvents\execute(), ApiQueryMyStashedFiles\execute(), ApiQueryPagePropNames\execute(), ApiQueryPageProps\execute(), ApiQueryStashImageInfo\execute(), ApiQueryTags\execute(), ApiQueryTokens\execute(), ApiQueryContributions\execute(), ApiQueryUserInfo\execute(), ApiQueryUsers\execute(), ApiRemoveAuthenticationData\execute(), ApiResetPassword\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiRsd\execute(), ApiSetNotificationTimestamp\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), ApiTag\execute(), ApiTokens\execute(), ApiUnblock\execute(), ApiUndelete\execute(), ApiUpload\execute(), ApiUserrights\execute(), ApiValidatePassword\execute(), ApiWatch\execute(), ApiFormatRaw\getFilename(), ApiQueryGadgetCategories\getList(), ApiFormatRaw\getMimeType(), getParameterFromSettings(), ApiFormatFeedWrapper\initPrinter(), ApiFormatRaw\initPrinter(), ApiQuery\outputGeneralPageInfo(), ApiQueryRevisionsBase\parseParameters(), ApiOpenSearch\populateResult(), ApiQueryAllCategories\run(), ApiQueryAllImages\run(), ApiQueryAllLinks\run(), ApiQueryAllPages\run(), ApiQueryCategoryMembers\run(), ApiQueryExtLinksUsage\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryPagesWithProp\run(), ApiQueryPrefixSearch\run(), ApiQueryProtectedTitles\run(), ApiQueryQueryPage\run(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQuerySearch\run(), ApiQueryWatchlist\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryAllRevisions\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 2114 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 963 of file ApiBase.php.
References $params, dieWithError(), 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 926 of file ApiBase.php.
References $params, dieWithError(), requireOnlyOneParameter(), and wfEscapeWikiText().
Referenced by ApiDelete\execute(), ApiEditPage\execute(), ApiParse\execute(), ApiProtect\execute(), ApiSetPageLanguage\execute(), ApiStashEdit\execute(), and ApiQueryCategoryMembers\run().
ApiBase::getWatchlistUser | ( | $params | ) |
Gets the user for whom to get the watchlist.
array | $params |
Definition at line 1687 of file ApiBase.php.
References $params, $user, checkUserRightsAny(), dieWithError(), ContextSource\getUser(), User\newFromName(), and wfEscapeWikiText().
Referenced by ApiQueryWatchlist\run(), and ApiQueryWatchlistRaw\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 991 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 ApiLogout, and ApiUserrights.
Definition at line 490 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 1364 of file ApiBase.php.
References addWarning(), and encodeParamName().
Referenced by getParameterFromSettings().
ApiBase::isDeprecated | ( | ) |
Indicates whether this module is deprecated.
Reimplemented in ApiLogin, ApiQueryDeletedrevs, and ApiTokens.
Definition at line 445 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 ApiCategoryTree, ApiOATHValidate, ApiQueryOATH, ApiCSPReport, and ApiStashEdit.
Definition at line 455 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 546 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 ApiAMCreateAccount, ApiClientLogin, ApiCSPReport, ApiDisabled, ApiHelp, ApiLinkAccount, ApiLogin, ApiLogout, ApiMain, ApiParamInfo, ApiQuery, ApiQueryAuthManagerInfo, ApiQueryTokens, and ApiRsd.
Definition at line 413 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 ApiAMCreateAccount, ApiBlock, ApiChangeAuthenticationData, ApiClearHasMsg, ApiCSPReport, ApiDelete, ApiEditPage, ApiEmailUser, ApiFileRevert, ApiImageRotate, ApiImport, ApiLinkAccount, ApiManageTags, ApiMergeHistory, ApiMove, ApiOptions, ApiPatrol, ApiProtect, ApiPurge, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiStashEdit, ApiTag, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, and ApiWatch.
Definition at line 428 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 569 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiLogin\execute(), ApiQueryDeletedrevs\execute(), ApiQueryTokens\execute(), ApiQueryUserInfo\getCurrentUserInfo(), ApiQueryInfo\getTokenFunctions(), ApiQueryRecentChanges\getTokenFunctions(), ApiQueryRevisions\getTokenFunctions(), ApiQueryUsers\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 2088 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 1741 of file ApiBase.php.
References ContextSource\$context, $params, and wfMessage().
Referenced by ApiStructureTest\checkMessage(), ApiAMCreateAccount\getFinalDescription(), getFinalDescription(), ApiClientLogin\getFinalDescription(), ApiLinkAccount\getFinalDescription(), getFinalParamDescription(), getFinalSummary(), ApiHelp\getHelpInternal(), and ApiParamInfo\getModuleInfo().
ApiBase::modifyHelp | ( | array & | $help, |
array | $options, | ||
array & | $tocData ) |
Called from ApiHelp before the pieces are joined together and returned.
This exists mainly for ApiMain to add the Permissions and Credits sections. Other modules probably don't need it.
string[] | &$help | Array of help data |
array | $options | Options passed to ApiHelp::getHelp |
array | &$tocData | If a TOC is being generated, this array has keys as anchors in the page and values as for Linker::generateTOC(). |
Reimplemented in ApiMain.
Definition at line 2543 of file ApiBase.php.
ApiBase::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Reimplemented in ApiBlock, ApiClearHasMsg, ApiCSPReport, ApiDelete, ApiEditPage, ApiEmailUser, ApiFileRevert, ApiImageRotate, ApiImport, ApiLogin, ApiLogout, ApiManageTags, ApiMergeHistory, ApiMove, ApiOptions, ApiPatrol, ApiProtect, ApiPurge, ApiRevisionDelete, ApiRollback, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiStashEdit, ApiTag, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, ApiValidatePassword, and ApiWatch.
Definition at line 436 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 ApiOATHValidate, ApiAMCreateAccount, ApiBlock, ApiChangeAuthenticationData, ApiClientLogin, ApiDelete, ApiEditPage, ApiEmailUser, ApiFileRevert, ApiImageRotate, ApiImport, ApiLinkAccount, ApiLogout, ApiManageTags, ApiMergeHistory, ApiMove, ApiOptions, ApiPatrol, ApiProtect, ApiRemoveAuthenticationData, ApiResetPassword, ApiRevisionDelete, ApiRollback, ApiSetNotificationTimestamp, ApiSetPageLanguage, ApiStashEdit, ApiTag, ApiUnblock, ApiUndelete, ApiUpload, ApiUserrights, and ApiWatch.
Definition at line 477 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 911 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 2902 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 2881 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 1404 of file ApiBase.php.
References $value, addDeprecation(), addWarning(), dieWithError(), explodeMultiValue(), LIMIT_SML1, LIMIT_SML2, and wfEscapeWikiText().
Referenced by getParameterFromSettings().
ApiBase::profileDBIn | ( | ) |
ApiBase::profileDBOut | ( | ) |
ApiBase::profileIn | ( | ) |
Definition at line 2605 of file ApiBase.php.
ApiBase::profileOut | ( | ) |
Definition at line 2613 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 851 of file ApiBase.php.
References $params, dieWithError(), and encodeParamName().
Referenced by ApiAMCreateAccount\execute(), ApiClientLogin\execute(), ApiComparePages\execute(), ApiEditPage\execute(), ApiLinkAccount\execute(), ApiQueryStashImageInfo\execute(), ApiStashEdit\execute(), and ApiTag\execute().
ApiBase::requireMaxOneParameter | ( | $params, | |
$required ) |
Die if more than one of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | $required,... | Names of parameters of which at most one must be set |
Definition at line 823 of file ApiBase.php.
References $params, dieWithError(), and encodeParamName().
Referenced by ApiExpandTemplates\execute(), ApiImport\execute(), ApiParse\execute(), ApiQueryAllUsers\execute(), ApiQueryBlocks\execute(), ApiQueryContributors\execute(), ApiQueryIWLinks\execute(), ApiQueryLangLinks\execute(), ApiQueryLogEvents\execute(), ApiQueryUsers\execute(), ApiSetNotificationTimestamp\execute(), ApiQueryRandom\run(), ApiQueryRecentChanges\run(), ApiQueryWatchlist\run(), ApiQueryAllRevisions\run(), ApiQueryDeletedRevisions\run(), and ApiQueryRevisions\run().
ApiBase::requireOnlyOneParameter | ( | $params, | |
$required ) |
Die if none or more than one of a certain set of parameters is set and not false.
array | $params | User provided set of parameters, as from $this->extractRequestParams() |
string | $required,... | Names of parameters of which exactly one must be set |
Definition at line 785 of file ApiBase.php.
References $params, dieWithError(), and encodeParamName().
Referenced by ApiBlock\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiPatrol\execute(), ApiQueryContributions\execute(), ApiResetPassword\execute(), ApiUnblock\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 881 of file ApiBase.php.
References $params, dieWithError(), encodeParamName(), ContextSource\getConfig(), getMain(), and ContextSource\getRequest().
Referenced by ApiOATHValidate\execute(), ApiLogin\execute(), and ApiValidatePassword\execute().
ApiBase::safeProfileOut | ( | ) |
ApiBase::setContinuationManager | ( | ApiContinuationManager | $manager = null | ) |
Set the continuation manager.
ApiContinuationManager | null | $manager |
Reimplemented in ApiMain.
Definition at line 695 of file ApiBase.php.
References dieDebug(), getMain(), and isMain().
Referenced by ApiImageRotate\execute(), ApiPurge\execute(), ApiQuery\execute(), ApiSetNotificationTimestamp\execute(), and ApiWatch\execute().
ApiBase::setWarning | ( | $warning | ) |
string | $warning | Warning message |
Definition at line 2653 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 1656 of file ApiBase.php.
References $value, WatchAction\doWatchOrUnwatch(), ContextSource\getUser(), and getWatchlistValue().
Referenced by ApiDelete\execute(), ApiMove\execute(), ApiProtect\execute(), ApiRollback\execute(), and ApiUndelete\execute().
ApiBase::shouldCheckMaxlag | ( | ) |
Indicates if this module needs maxlag to be checked.
Reimplemented in ApiHelp.
Definition at line 405 of file ApiBase.php.
|
static |
Truncate an array to a certain length.
array | &$arr | Array to truncate |
int | $limit | Maximum length |
Definition at line 1671 of file ApiBase.php.
|
protected |
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition at line 2643 of file ApiBase.php.
References ContextSource\getRequest(), and wfTransactionalTimeLimit().
Referenced by ApiDelete\execute(), ApiEditPage\execute(), ApiFileRevert\execute(), ApiImageRotate\execute(), ApiImport\execute(), ApiMergeHistory\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiRollback\execute(), ApiSetPageLanguage\execute(), and ApiUndelete\execute().
|
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 1485 of file ApiBase.php.
References $value, ApiMessage\create(), encodeParamName(), getMain(), and warnOrDie().
Referenced by ApiQueryDeletedrevs\execute(), getParameterFromSettings(), and ApiQueryRevisionsBase\parseParameters().
|
protected |
Validate and normalize parameters of type 'timestamp'.
string | $value | Parameter value |
string | $encParamName | Parameter name |
Definition at line 1538 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 1575 of file ApiBase.php.
References ContextSource\getRequest(), ApiQueryTokens\getToken(), ApiQueryTokens\getTokenTypeSalts(), ContextSource\getUser(), getWebUITokenSalt(), and needsToken().
|
private |
Validate and normalize parameters of type 'user'.
string | $value | Parameter value |
string | $encParamName | Parameter name |
Definition at line 1610 of file ApiBase.php.
References $value, dieWithError(), ExternalUserNames\isExternal(), User\isValidUserName(), User\newFromName(), RE_IP_BYTE, 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 1919 of file ApiBase.php.
References addWarning(), and dieWithError().
Referenced by validateLimit().
|
staticprivate |
Maps extension paths to info arrays.
Definition at line 250 of file ApiBase.php.
|
staticprivate |
Definition at line 2734 of file ApiBase.php.
|
private |
Definition at line 253 of file ApiBase.php.
|
private |
Definition at line 255 of file ApiBase.php.
Referenced by getModuleName().
|
private |
Definition at line 255 of file ApiBase.php.
Referenced by getModulePrefix().
|
private |
Definition at line 259 of file ApiBase.php.
Referenced by getModuleSourceInfo().
|
private |
Definition at line 257 of file ApiBase.php.
|
private |
Definition at line 256 of file ApiBase.php.
Referenced by getDB().
const ApiBase::ALL_DEFAULT_STRING = '*' |
Definition at line 231 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 247 of file ApiBase.php.
Referenced by ApiPageSet\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), ApiStructureTest\testDocumentationExists(), and ApiStructureTest\testParameterConsistency().
const ApiBase::LIMIT_BIG1 = 500 |
Fast query, standard limit.
Definition at line 234 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryDeletedrevs\execute(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().
const ApiBase::LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit.
Definition at line 236 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryDeletedrevs\execute(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiQueryRevisionsBase\parseParameters(), and ApiQueryBacklinks\run().
const ApiBase::LIMIT_SML1 = 50 |
Slow query, standard limit.
Definition at line 238 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 240 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 180 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), and ApiBaseTest\provideGetParameterFromSettings().
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 102 of file ApiBase.php.
Referenced by ApiProtect\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), and ApiBaseTest\provideGetParameterFromSettings().
const ApiBase::PARAM_DEPRECATED = 7 |
(boolean) Is the parameter deprecated (will show a warning)?
Definition at line 105 of file ApiBase.php.
Referenced by ApiWatch\getAllowedParams(), ApiDelete\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), and ApiBaseTest\provideGetParameterFromSettings().
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 202 of file ApiBase.php.
Referenced by ApiParse\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), getFinalParamDescription(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_DFLT = 0 |
(null|boolean|integer|string) Default value of the parameter.
Definition at line 48 of file ApiBase.php.
Referenced by buildCommonApiParams(), buildProfileApiParam(), ApiFeedWatchlist\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiDelete\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiFormatXml\getAllowedParams(), ApiHelp\getAllowedParams(), ApiMain\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiMove\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiOptions\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiTag\getAllowedParams(), ApiTokens\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiUpload\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiFormatBase\getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), ApiBaseTest\provideGetParameterFromSettings(), ApiFormatBaseTest\testForceDefaultParams(), ApiOpenSearchTest\testGetAllowedParams(), ApiFormatBaseTest\testGetAllowedParams(), ApiStructureTest\testParameterConsistency(), and ApiStructureTest\validateDefault().
const ApiBase::PARAM_EXTRA_NAMESPACES = 18 |
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values.
Definition at line 186 of file ApiBase.php.
Referenced by ApiQueryLogEvents\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\validateDefault().
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 124 of file ApiBase.php.
Referenced by ReCaptcha\APIGetAllowedParams(), ReCaptchaNoCaptcha\APIGetAllowedParams(), SimpleCaptcha\APIGetAllowedParams(), buildCommonApiParams(), buildProfileApiParam(), ApiFeedWatchlist\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiPurge\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiWatch\getAllowedParams(), ApiQueryReferences\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiFormatBase\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiFormatXml\getAllowedParams(), ApiLogin\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryInfo\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), getFinalParamDescription(), ApiAuthManagerHelper\getStandardParams(), ApiStructureTest\testDocumentationExists(), and ApiFormatBaseTest\testGetAllowedParams().
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 131 of file ApiBase.php.
Referenced by ApiAMCreateAccount\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiRollback\getAllowedParams(), ApiUserrights\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 141 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}. Specify an empty array to use the default message key for all values.
Definition at line 157 of file ApiBase.php.
Referenced by buildProfileApiParam(), ApiFeedWatchlist\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiParse\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\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 51 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiImageRotate\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiSpamBlacklist\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiBlock\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiDelete\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiHelp\getAllowedParams(), ApiImport\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiMove\getAllowedParams(), ApiOptions\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPageProps\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiTag\getAllowedParams(), ApiTokens\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiUpload\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\validateDefault().
const ApiBase::PARAM_ISMULTI_LIMIT1 = 21 |
(integer) Maximum number of values, for normal users.
Must be used with PARAM_ISMULTI.
Definition at line 208 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), 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 215 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_MAX = 3 |
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition at line 90 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
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 96 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiQueryLogEvents\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_MAX_BYTES = 23 |
(integer) Maximum length of a string in bytes (in UTF-8 encoding).
Definition at line 221 of file ApiBase.php.
Referenced by ApiParamInfo\getModuleInfo(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_MAX_CHARS = 24 |
(integer) Maximum length of a string in characters (unicode codepoints).
Definition at line 227 of file ApiBase.php.
Referenced by ApiParamInfo\getModuleInfo(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_MIN = 5 |
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition at line 99 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiFeedWatchlist\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiUpload\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_RANGE_ENFORCE = 9 |
(boolean) For PARAM_TYPE 'integer', enforce PARAM_MIN and PARAM_MAX?
Definition at line 117 of file ApiBase.php.
Referenced by ApiEditPage\getAllowedParams(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
const ApiBase::PARAM_REQUIRED = 8 |
(boolean) Is the parameter required?
Definition at line 111 of file ApiBase.php.
Referenced by buildCommonApiParams(), ApiImageRotate\getAllowedParams(), ApiCategoryTree\getAllowedParams(), ApiOATHValidate\getAllowedParams(), ApiSpamBlacklist\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiCheckToken\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiLogin\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiMove\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiValidatePassword\getAllowedParams(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), ApiBaseTest\provideGetParameterFromSettings(), and ApiStructureTest\testParameterConsistency().
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 193 of file ApiBase.php.
Referenced by ApiCheckToken\getAllowedParams(), ApiLogin\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiBaseTest\provideGetParameterFromSettings(), and ApiBaseTest\testGetParameterFromSettings().
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 165 of file ApiBase.php.
Referenced by ApiPageSet\getAllowedParams(), getFinalParamDescription(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), and ApiBaseTest\provideGetParameterFromSettings().
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 172 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 87 of file ApiBase.php.
Referenced by buildCommonApiParams(), buildProfileApiParam(), ApiFeedWatchlist\getAllowedParams(), ApiImageRotate\getAllowedParams(), ApiPageSet\getAllowedParams(), ApiQuery\getAllowedParams(), ApiQueryLogEvents\getAllowedParams(), ApiSetNotificationTimestamp\getAllowedParams(), ApiWatch\getAllowedParams(), ApiCategoryTree\getAllowedParams(), ApiQueryGadgetCategories\getAllowedParams(), ApiQueryGadgets\getAllowedParams(), ApiOATHValidate\getAllowedParams(), ApiQueryOATH\getAllowedParams(), ApiQueryTitleBlacklist\getAllowedParams(), ApiBlock\getAllowedParams(), ApiCheckToken\getAllowedParams(), ApiComparePages\getAllowedParams(), ApiCSPReport\getAllowedParams(), ApiDelete\getAllowedParams(), ApiEditPage\getAllowedParams(), ApiEmailUser\getAllowedParams(), ApiExpandTemplates\getAllowedParams(), ApiFeedContributions\getAllowedParams(), ApiFeedRecentChanges\getAllowedParams(), ApiFileRevert\getAllowedParams(), ApiFormatJson\getAllowedParams(), ApiFormatPhp\getAllowedParams(), ApiImport\getAllowedParams(), ApiLogin\getAllowedParams(), ApiMain\getAllowedParams(), ApiManageTags\getAllowedParams(), ApiMergeHistory\getAllowedParams(), ApiMove\getAllowedParams(), ApiOpenSearch\getAllowedParams(), ApiOptions\getAllowedParams(), ApiParamInfo\getAllowedParams(), ApiParse\getAllowedParams(), ApiPatrol\getAllowedParams(), ApiProtect\getAllowedParams(), ApiQueryAllCategories\getAllowedParams(), ApiQueryAllDeletedRevisions\getAllowedParams(), ApiQueryAllImages\getAllowedParams(), ApiQueryAllLinks\getAllowedParams(), ApiQueryAllMessages\getAllowedParams(), ApiQueryAllPages\getAllowedParams(), ApiQueryAllRevisions\getAllowedParams(), ApiQueryAllUsers\getAllowedParams(), ApiQueryAuthManagerInfo\getAllowedParams(), ApiQueryBacklinks\getAllowedParams(), ApiQueryBacklinksprop\getAllowedParams(), ApiQueryBlocks\getAllowedParams(), ApiQueryCategories\getAllowedParams(), ApiQueryCategoryMembers\getAllowedParams(), ApiQueryContributors\getAllowedParams(), ApiQueryDeletedRevisions\getAllowedParams(), ApiQueryDeletedrevs\getAllowedParams(), ApiQueryDuplicateFiles\getAllowedParams(), ApiQueryExternalLinks\getAllowedParams(), ApiQueryExtLinksUsage\getAllowedParams(), ApiQueryFilearchive\getAllowedParams(), ApiQueryFileRepoInfo\getAllowedParams(), ApiQueryImageInfo\getAllowedParams(), ApiQueryImages\getAllowedParams(), ApiQueryInfo\getAllowedParams(), ApiQueryIWBacklinks\getAllowedParams(), ApiQueryIWLinks\getAllowedParams(), ApiQueryLangBacklinks\getAllowedParams(), ApiQueryLangLinks\getAllowedParams(), ApiQueryLinks\getAllowedParams(), ApiQueryMyStashedFiles\getAllowedParams(), ApiQueryPagePropNames\getAllowedParams(), ApiQueryPagesWithProp\getAllowedParams(), ApiQueryProtectedTitles\getAllowedParams(), ApiQueryQueryPage\getAllowedParams(), ApiQueryRandom\getAllowedParams(), ApiQueryRecentChanges\getAllowedParams(), ApiQueryRevisions\getAllowedParams(), ApiQueryRevisionsBase\getAllowedParams(), ApiQuerySearch\getAllowedParams(), ApiQuerySiteinfo\getAllowedParams(), ApiQueryStashImageInfo\getAllowedParams(), ApiQueryTags\getAllowedParams(), ApiQueryTokens\getAllowedParams(), ApiQueryContributions\getAllowedParams(), ApiQueryUserInfo\getAllowedParams(), ApiQueryUsers\getAllowedParams(), ApiQueryWatchlist\getAllowedParams(), ApiQueryWatchlistRaw\getAllowedParams(), ApiResetPassword\getAllowedParams(), ApiRevisionDelete\getAllowedParams(), ApiRollback\getAllowedParams(), ApiSetPageLanguage\getAllowedParams(), ApiStashEdit\getAllowedParams(), ApiTag\getAllowedParams(), ApiTokens\getAllowedParams(), ApiUnblock\getAllowedParams(), ApiUndelete\getAllowedParams(), ApiUpload\getAllowedParams(), ApiUserrights\getAllowedParams(), ApiValidatePassword\getAllowedParams(), ApiQueryGadgets\getExamplesMessages(), ApiOpenSearch\getFormat(), ApiHelp\getHelpInternal(), ApiParamInfo\getModuleInfo(), getParameterFromSettings(), ApiAuthManagerHelper\getStandardParams(), ApiBaseTest\provideGetParameterFromSettings(), ApiStructureTest\testDocumentationExists(), ApiBaseTest\testGetParameterFromSettings(), ApiStructureTest\testParameterConsistency(), and ApiStructureTest\validateDefault().
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 148 of file ApiBase.php.
Referenced by ApiHelp\getHelpInternal().