MediaWiki master
MediaWiki\Api Namespace Reference

Namespaces

namespace  Hook
 
namespace  Validator
 

Classes

class  ApiAcquireTempUserName
 Acquire a temporary user username and stash it in the current session, if temp account creation is enabled and the current user is logged out. More...
 
class  ApiAMCreateAccount
 Create an account with AuthManager. More...
 
class  ApiAuthManagerHelper
 Helper class for AuthManager-using API modules. More...
 
class  ApiBase
 This abstract class implements many basic API functions, and is the base of all API classes. More...
 
class  ApiBlock
 API module that facilitates the blocking of users. More...
 
class  ApiChangeAuthenticationData
 Change authentication data with AuthManager. More...
 
class  ApiChangeContentModel
 Api module to change the content model of existing pages. More...
 
class  ApiCheckToken
 
class  ApiClearHasMsg
 API module that clears the hasmsg flag for current user. More...
 
class  ApiClientLogin
 Log in to the wiki with AuthManager. More...
 
class  ApiComparePages
 
class  ApiContinuationManager
 This manages continuation state. More...
 
class  ApiCSPReport
 Api module to receive and log CSP violation reports. More...
 
class  ApiDelete
 API module that facilitates deleting pages. More...
 
class  ApiDisabled
 API module that dies with an error immediately. More...
 
class  ApiEditPage
 A module that allows for editing and creating pages. More...
 
class  ApiEmailUser
 API Module to facilitate sending of emails to users. More...
 
class  ApiEntryPoint
 Implementation of the API entry point, for web browser navigations, usually via an Action or SpecialPage subclass. More...
 
class  ApiErrorFormatter
 Formats errors and warnings for the API, and add them to the associated ApiResult. More...
 
class  ApiErrorFormatter_BackCompat
 Format errors and warnings in the old style, for backwards compatibility. More...
 
class  ApiExpandTemplates
 API module that functions as a shortcut to the wikitext preprocessor. More...
 
class  ApiFeedContributions
 
class  ApiFeedRecentChanges
 Recent changes feed. More...
 
class  ApiFeedWatchlist
 This action allows users to get their watchlist items in RSS/Atom formats. More...
 
class  ApiFileRevert
 
class  ApiFormatBase
 This is the abstract base class for API formatters. More...
 
class  ApiFormatFeedWrapper
 This printer is used to wrap an instance of the Feed class. More...
 
class  ApiFormatJson
 API JSON output formatter. More...
 
class  ApiFormatNone
 Formatter that outputs nothing, for when you don't care about the response at all. More...
 
class  ApiFormatPhp
 API Serialized PHP output formatter. More...
 
class  ApiFormatRaw
 Formatter that spits out anything you like with any desired MIME type. More...
 
class  ApiFormatXml
 API XML output formatter. More...
 
class  ApiFormatXmlRsd
 
class  ApiHelp
 Class to output help for an API module. More...
 
class  ApiHelpParamValueMessage
 Message subclass that prepends wikitext for API help. More...
 
class  ApiHookRunner
 This class provides an implementation of the hook interfaces used by the core Action API, forwarding hook calls to HookContainer for dispatch to extensions. More...
 
class  ApiImageRotate
 
class  ApiImport
 API module that imports an XML file like Special:Import does. More...
 
class  ApiImportReporter
 Import reporter for the API. More...
 
class  ApiLinkAccount
 Link an account with AuthManager. More...
 
class  ApiLogin
 Unit to authenticate log-in attempts to the current wiki. More...
 
class  ApiLogout
 API module to allow users to log out of the wiki. More...
 
class  ApiMain
 This is the main API class, used for both external and internal processing. More...
 
class  ApiManageTags
 
class  ApiMergeHistory
 API Module to merge page histories. More...
 
class  ApiMessage
 Extension of Message implementing IApiMessage. More...
 
class  ApiModuleManager
 This class holds a list of modules and handles instantiation. More...
 
class  ApiMove
 API Module to move pages. More...
 
class  ApiOpenSearch
 
class  ApiOpenSearchFormatJson
 
class  ApiOptions
 API module that facilitates the changing of user's preferences. More...
 
class  ApiOptionsBase
 The base class for core's ApiOptions and two modules in the GlobalPreferences extension. More...
 
class  ApiPageSet
 This class contains a list of pages that the client has requested. More...
 
class  ApiParamInfo
 
class  ApiParse
 
class  ApiPatrol
 Allows user to patrol pages. More...
 
class  ApiProtect
 
class  ApiPurge
 API interface for page purging. More...
 
class  ApiQuery
 This is the main query class. More...
 
class  ApiQueryAllCategories
 Query module to enumerate all categories, even the ones that don't have category pages. More...
 
class  ApiQueryAllDeletedRevisions
 Query module to enumerate all deleted revisions. More...
 
class  ApiQueryAllImages
 Query module to enumerate all images. More...
 
class  ApiQueryAllLinks
 Query module to enumerate links from all pages together. More...
 
class  ApiQueryAllMessages
 A query action to return messages from site message cache. More...
 
class  ApiQueryAllPages
 Query module to enumerate all available pages. More...
 
class  ApiQueryAllRevisions
 Query module to enumerate all revisions. More...
 
class  ApiQueryAllUsers
 Query module to enumerate all registered users. More...
 
class  ApiQueryAuthManagerInfo
 A query action to return meta information about AuthManager state. More...
 
class  ApiQueryBacklinks
 This is a three-in-one module to query: More...
 
class  ApiQueryBacklinksprop
 This implements prop=redirects, prop=linkshere, prop=catmembers, prop=transcludedin, and prop=fileusage. More...
 
class  ApiQueryBase
 This is a base class for all Query modules. More...
 
class  ApiQueryBlocks
 Query module to enumerate all user blocks. More...
 
class  ApiQueryCategories
 A query module to enumerate categories the set of pages belong to. More...
 
class  ApiQueryCategoryInfo
 This query adds the "<categories>" subelement to all pages with the list of categories the page is in. More...
 
class  ApiQueryCategoryMembers
 A query module to enumerate pages that belong to a category. More...
 
class  ApiQueryContributors
 A query module to show contributors to a page. More...
 
class  ApiQueryDeletedRevisions
 Query module to enumerate deleted revisions for pages. More...
 
class  ApiQueryDeletedrevs
 Query module to enumerate all deleted revisions. More...
 
class  ApiQueryDisabled
 API module that does nothing. More...
 
class  ApiQueryDuplicateFiles
 A query module to list duplicates of the given file(s) More...
 
class  ApiQueryExternalLinks
 A query module to list all external URLs found on a given set of pages. More...
 
class  ApiQueryExtLinksUsage
 
class  ApiQueryFilearchive
 Query module to enumerate all deleted files. More...
 
class  ApiQueryFileRepoInfo
 A query action to return meta information about the foreign file repos configured on the wiki. More...
 
class  ApiQueryGeneratorBase
 
class  ApiQueryImageInfo
 A query action to get image information and upload history. More...
 
class  ApiQueryImages
 This query adds an "<images>" subelement to all pages with the list of images embedded into those pages. More...
 
class  ApiQueryInfo
 A query module to show basic page information. More...
 
class  ApiQueryIWBacklinks
 This gives links pointing to the given interwiki. More...
 
class  ApiQueryIWLinks
 A query module to list all interwiki links on a page. More...
 
class  ApiQueryLangBacklinks
 This gives links pointing to the given interwiki. More...
 
class  ApiQueryLangLinks
 A query module to list all langlinks (links to corresponding foreign language pages). More...
 
class  ApiQueryLanguageinfo
 API module to enumerate language information. More...
 
class  ApiQueryLinks
 A query module to list all wiki links on a given set of pages. More...
 
class  ApiQueryLogEvents
 Query action to List the log events, with optional filtering by various parameters. More...
 
class  ApiQueryMyStashedFiles
 action=query&list=mystashedfiles module, gets all stashed files for the current user. More...
 
class  ApiQueryPagePropNames
 A query module to list used page props. More...
 
class  ApiQueryPageProps
 A query module to show basic page information. More...
 
class  ApiQueryPagesWithProp
 A query module to enumerate pages that use a particular prop. More...
 
class  ApiQueryPrefixSearch
 
class  ApiQueryProtectedTitles
 Query module to enumerate all create-protected pages. More...
 
class  ApiQueryQueryPage
 Query module to get the results of a QueryPage-based special page. More...
 
class  ApiQueryRandom
 Query module to get list of random pages. More...
 
class  ApiQueryRecentChanges
 A query action to enumerate the recent changes that were done to the wiki. More...
 
class  ApiQueryRevisions
 A query action to enumerate revisions of a given page, or show top revisions of multiple pages. More...
 
class  ApiQueryRevisionsBase
 A base class for functions common to producing a list of revisions. More...
 
class  ApiQuerySearch
 Query module to perform full text search within wiki titles and content. More...
 
class  ApiQuerySiteinfo
 A query action to return meta information about the wiki site. More...
 
class  ApiQueryStashImageInfo
 A query action to get image information from temporarily stashed files. More...
 
class  ApiQueryTags
 Query module to enumerate change tags. More...
 
class  ApiQueryTokens
 Module to fetch tokens via action=query&meta=tokens. More...
 
class  ApiQueryUserContribs
 This query action adds a list of a specified user's contributions to the output. More...
 
class  ApiQueryUserInfo
 Query module to get information about the currently logged-in user. More...
 
class  ApiQueryUsers
 Query module to get information about a list of users. More...
 
class  ApiQueryWatchlist
 This query action allows clients to retrieve a list of recently modified pages that are part of the logged-in user's watchlist. More...
 
class  ApiQueryWatchlistRaw
 This query action allows clients to retrieve a list of pages on the logged-in user's watchlist. More...
 
class  ApiRawMessage
 Extension of RawMessage implementing IApiMessage. More...
 
class  ApiRemoveAuthenticationData
 Remove authentication data from AuthManager. More...
 
class  ApiResetPassword
 Reset password, with AuthManager. More...
 
class  ApiResult
 This class represents the result of the API operations. More...
 
class  ApiRevisionDelete
 API interface to RevDel. More...
 
class  ApiRollback
 
class  ApiRsd
 API module for sending out RSD information. More...
 
interface  ApiSerializable
 This interface allows for overriding the default conversion applied by ApiResult::validateValue(). More...
 
class  ApiSetNotificationTimestamp
 API interface for setting the wl_notificationtimestamp field. More...
 
class  ApiSetPageLanguage
 API module that facilitates changing the language of a page. More...
 
class  ApiStashEdit
 Prepare an edit in shared cache so that it can be reused on edit. More...
 
class  ApiTag
 
class  ApiUnblock
 API module that facilitates the unblocking of users. More...
 
class  ApiUndelete
 
class  ApiUpload
 
class  ApiUsageException
 Exception used to abort API execution with an error. More...
 
class  ApiUserrights
 
class  ApiValidatePassword
 
class  ApiWatch
 API module to allow users to watch a page. More...
 
interface  IApiMessage
 Interface for messages with machine-readable data for use by the API. More...
 

Functions

 __serialize ()
 
 __unserialize ( $data)
 
 buildCommonApiParams ( $isScrollable=true)
 The set of api parameters that are shared between api calls that call the SearchEngine.
 
 buildSearchEngine (?array $params=null)
 Build the search engine to use.
 
 getApiCode ()
 
 getApiData ()
 
 getContext ()
 
 getExpiryFromParams (array $params)
 Get formatted expiry from the given parameters, or null if no expiry was provided.
 
 getRequest ()
 
 getSearchProfileParams ()
 
 getUser ()
 
 getWatchlistExpiry (WatchedItemStoreInterface $store, PageIdentity $page, UserIdentity $user)
 Get existing expiry from the database.
 
 getWatchlistParams (array $watchOptions=[])
 Get additional allow params specific to watchlisting.
 
 getWatchlistValue (string $watchlist, PageIdentity $page, User $user, ?string $userOption=null)
 Return true if we're to watch the page, false if not.
 
 setApiCode ( $code, ?array $data=null)
 
 setApiData (array $data)
 
 setWatch (string $watch, PageIdentity $page, User $user, ?string $userOption=null, ?string $expiry=null)
 Set a watch (or unwatch) based the based on a watchlist parameter.
 
Methods required from ApiQueryBase
 getDB ()
 
 getAuthority ()
 
 addTables ( $tables, $alias=null)
 
 addFields ( $fields)
 
 addWhere ( $conds)
 
 addJoinConds ( $conds)
 
 getQueryBuilder ()
 

Variables

string null $apiCode = null
 
array $apiData = []
 
trait ApiBlockInfoTrait
 
trait ApiCreateTempUserTrait
 Methods needed by APIs that create a temporary user.
 
trait ApiMessageTrait
 Trait to implement the IApiMessage interface for Message subclasses.
 
trait ApiQueryBlockInfoTrait
 
trait ApiWatchlistTrait
 An ApiWatchlistTrait adds class properties and convenience methods for APIs that allow you to watch a page.
 
trait SearchApi
 Traits for API components that use a SearchEngine.
 

Detailed Description

Todo

: create a UploadCommandFactory and UploadComand classes to share logic with Special:Upload

: split the different cases of upload in subclasses or submethods.

Function Documentation

◆ __serialize()

MediaWiki\Api\__serialize ( )

Definition at line 147 of file ApiMessageTrait.php.

References MediaWiki\Api\$apiCode, and MediaWiki\Api\$apiData.

◆ __unserialize()

MediaWiki\Api\__unserialize ( $data)

Definition at line 155 of file ApiMessageTrait.php.

◆ addFields()

MediaWiki\Api\addFields ( $fields)
abstractprotected

◆ addJoinConds()

MediaWiki\Api\addJoinConds ( $conds)
abstractprotected

◆ addTables()

MediaWiki\Api\addTables ( $tables,
$alias = null )
abstractprotected
See also
ApiQueryBase::addTables
Parameters
string | array$tables
string | null$alias

Referenced by MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), and MediaWiki\Api\ApiQueryRevisions\run().

◆ addWhere()

MediaWiki\Api\addWhere ( $conds)
abstractprotected

◆ buildCommonApiParams()

MediaWiki\Api\buildCommonApiParams ( $isScrollable = true)

The set of api parameters that are shared between api calls that call the SearchEngine.

Primarily this defines parameters that are utilized by self::buildSearchEngine().

Parameters
bool$isScrollableTrue if the api offers scrolling
Returns
array

Definition at line 72 of file SearchApi.php.

References $params, MediaWiki\Api\ApiBase\LIMIT_BIG1, MediaWiki\Api\ApiBase\LIMIT_BIG2, NS_MAIN, and MediaWiki\Api\ApiBase\PARAM_HELP_MSG.

Referenced by MediaWiki\Api\ApiOpenSearch\getAllowedParams(), MediaWiki\Api\ApiQueryPrefixSearch\getAllowedParams(), and MediaWiki\Api\ApiQuerySearch\getAllowedParams().

◆ buildSearchEngine()

MediaWiki\Api\buildSearchEngine ( ?array $params = null)

Build the search engine to use.

If $params is provided then the following searchEngine options will be set:

  • backend: which search backend to use
  • limit: mandatory
  • offset: optional
  • namespace: mandatory
  • search engine profiles defined by SearchApi::getSearchProfileParams()
    Parameters
    array | null$paramsAPI request params (must be sanitized by ApiBase::extractRequestParams() before)
    Returns
    SearchEngine

Definition at line 182 of file SearchApi.php.

References $params, and MediaWiki\Api\getSearchProfileParams().

◆ getApiCode()

MediaWiki\Api\getApiCode ( )

Definition at line 106 of file ApiMessageTrait.php.

References MediaWiki\Api\$apiCode.

◆ getApiData()

MediaWiki\Api\getApiData ( )

Definition at line 139 of file ApiMessageTrait.php.

References MediaWiki\Api\$apiData.

◆ getAuthority()

MediaWiki\Api\getAuthority ( )
abstract
See also
IContextSource::getAuthority
Returns
Authority

Referenced by MediaWiki\Api\ApiBase\addBlockInfoToStatus(), MediaWiki\Api\ApiMain\canApiHighLimits(), MediaWiki\Api\ApiMain\checkAsserts(), MediaWiki\Api\ApiBase\checkTitleUserPermissions(), MediaWiki\Api\ApiBase\checkUserRightsAny(), MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiChangeContentModel\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEmailUser\execute(), MediaWiki\Api\ApiFileRevert\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiManageTags\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryImageInfo\execute(), MediaWiki\Api\ApiQueryLogEvents\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiSetPageLanguage\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiFeedContributions\feedItem(), MediaWiki\Api\ApiQueryLogEvents\getCacheMode(), MediaWiki\Api\ApiQueryUserInfo\getCurrentUserInfo(), MediaWiki\Api\ApiMergeHistory\merge(), MediaWiki\Api\ApiMove\moveSubpages(), MediaWiki\Api\ApiUpload\performUpload(), MediaWiki\Api\ApiTag\processIndividual(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), MediaWiki\Api\ApiQueryDeletedRevisions\run(), MediaWiki\Api\ApiQueryRevisions\run(), and MediaWiki\Api\ApiQueryBase\userCanSeeRevDel().

◆ getContext()

◆ getDB()

◆ getExpiryFromParams()

MediaWiki\Api\getExpiryFromParams ( array $params)
protected

◆ getQueryBuilder()

MediaWiki\Api\getQueryBuilder ( )
abstractprotected

◆ getRequest()

MediaWiki\Api\getRequest ( )
abstract
See also
IContextSource::getRequest
Returns
WebRequest

Referenced by MediaWiki\Api\ApiMain\__construct(), MediaWiki\Api\ApiMain\checkConditionalRequestHeaders(), MediaWiki\Api\ApiMain\checkExecutePermissions(), MediaWiki\Api\ApiMain\checkMaxLag(), MediaWiki\Api\ApiFormatBase\closePrinter(), MediaWiki\Api\ApiBase\dieBlocked(), MediaWiki\Api\ApiAcquireTempUserName\execute(), MediaWiki\Api\ApiCheckToken\execute(), MediaWiki\Api\ApiCSPReport\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiEntryPoint\execute(), MediaWiki\Api\ApiFeedRecentChanges\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryTokens\execute(), MediaWiki\Api\ApiMain\executeActionWithErrorHandling(), MediaWiki\Api\ApiMain\getCheck(), MediaWiki\Api\ApiQueryUserInfo\getCurrentUserInfo(), MediaWiki\Api\ApiMain\getUpload(), MediaWiki\Api\ApiMain\getUserAgent(), MediaWiki\Api\ApiMain\getVal(), MediaWiki\Api\ApiMain\handleCORS(), MediaWiki\Api\ApiMain\handleException(), MediaWiki\Api\ApiQuery\isReadMode(), MediaWiki\Api\ApiMain\lacksSameOriginSecurity(), MediaWiki\Api\ApiBase\logFeatureUsage(), MediaWiki\Api\ApiMain\logRequest(), MediaWiki\Api\ApiMain\reportUnusedParams(), MediaWiki\Api\ApiBase\requirePostedParameters(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiMain\sendCacheHeaders(), MediaWiki\Api\ApiMain\setRequestExpectations(), MediaWiki\Api\ApiMain\setupExternalResponse(), MediaWiki\Api\ApiBase\useTransactionalTimeLimit(), MediaWiki\Api\ApiOptionsBase\validate(), and MediaWiki\Api\ApiBase\validateToken().

◆ getSearchProfileParams()

MediaWiki\Api\getSearchProfileParams ( )
abstract
Returns
array[] array of arrays mapping from parameter name to a two value map containing 'help-message' and 'profile-type' keys.

Referenced by MediaWiki\Api\buildSearchEngine().

◆ getUser()

MediaWiki\Api\getUser ( )
abstract
See also
IContextSource::getUser
Returns
UserIdentity

Referenced by MediaWiki\Api\ApiMain\checkAsserts(), MediaWiki\Api\ApiMain\checkConditionalRequestHeaders(), MediaWiki\Api\ApiMain\checkExecutePermissions(), MediaWiki\Api\ApiBase\checkTitleUserPermissions(), MediaWiki\Api\ApiBase\dieBlocked(), MediaWiki\Api\ApiAcquireTempUserName\execute(), MediaWiki\Api\ApiAMCreateAccount\execute(), MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiCheckToken\execute(), MediaWiki\Api\ApiClearHasMsg\execute(), MediaWiki\Api\ApiClientLogin\execute(), MediaWiki\Api\ApiCSPReport\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiLinkAccount\execute(), MediaWiki\Api\ApiLogin\execute(), MediaWiki\Api\ApiLogout\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiPatrol\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiQueryAuthManagerInfo\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryFilearchive\execute(), MediaWiki\Api\ApiQueryMyStashedFiles\execute(), MediaWiki\Api\ApiQueryStashImageInfo\execute(), MediaWiki\Api\ApiQueryTokens\execute(), MediaWiki\Api\ApiRemoveAuthenticationData\execute(), MediaWiki\Api\ApiResetPassword\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiStashEdit\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), MediaWiki\Api\ApiUpload\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiValidatePassword\execute(), MediaWiki\Api\ApiWatch\execute(), MediaWiki\Api\ApiQueryRecentChanges\extractRowInfo(), MediaWiki\Api\ApiQueryUserInfo\getCurrentUserInfo(), MediaWiki\Api\ApiQueryUserInfo\getLatestContributionTime(), MediaWiki\Api\ApiQueryUserInfo\getRateLimits(), MediaWiki\Api\ApiOptionsBase\getUserForUpdatesOrNull(), MediaWiki\Api\ApiBase\getWatchlistUser(), MediaWiki\Api\ApiUpload\handleStashException(), MediaWiki\Api\ApiBase\logFeatureUsage(), MediaWiki\Api\ApiMain\logRequest(), MediaWiki\Api\ApiUpload\performUpload(), MediaWiki\Api\ApiTag\processIndividual(), MediaWiki\Api\ApiQueryRecentChanges\run(), MediaWiki\Api\ApiUpload\selectUploadModule(), MediaWiki\Api\ApiBase\validateToken(), and MediaWiki\Api\ApiUpload\verifyUpload().

◆ getWatchlistExpiry()

MediaWiki\Api\getWatchlistExpiry ( WatchedItemStoreInterface $store,
PageIdentity $page,
UserIdentity $user )
protected

Get existing expiry from the database.

Parameters
WatchedItemStoreInterface$store
PageIdentity$page
UserIdentity$userThe user to get the expiry for.
Returns
string|null

Definition at line 177 of file ApiWatchlistTrait.php.

References MediaWiki\Api\ApiResult\formatExpiry().

Referenced by MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiUnblock\execute(), and MediaWiki\Api\ApiUserrights\execute().

◆ getWatchlistParams()

MediaWiki\Api\getWatchlistParams ( array $watchOptions = [])
protected

Get additional allow params specific to watchlisting.

This should be merged in with the result of self::getAllowedParams().

This purposefully does not include the deprecated 'watch' and 'unwatch' parameters that some APIs still accept.

Parameters
string[]$watchOptions
Returns
array

Definition at line 58 of file ApiWatchlistTrait.php.

Referenced by MediaWiki\Api\ApiDelete\getAllowedParams(), MediaWiki\Api\ApiEditPage\getAllowedParams(), MediaWiki\Api\ApiMove\getAllowedParams(), MediaWiki\Api\ApiProtect\getAllowedParams(), MediaWiki\Api\ApiRollback\getAllowedParams(), MediaWiki\Api\ApiUndelete\getAllowedParams(), and MediaWiki\Api\ApiUpload\getAllowedParams().

◆ getWatchlistValue()

MediaWiki\Api\getWatchlistValue ( string $watchlist,
PageIdentity $page,
User $user,
?string $userOption = null )
protected

Return true if we're to watch the page, false if not.

Parameters
string$watchlistValid values: 'watch', 'unwatch', 'preferences', 'nochange'
PageIdentity$pageThe page under consideration
User$userThe user get the value for.
string | null$userOptionThe user option to consider when $watchlist=preferences. If not set will use watchdefault always and watchcreations if $page doesn't exist.
Returns
bool

Definition at line 115 of file ApiWatchlistTrait.php.

References MediaWiki\Page\PageIdentity\exists(), and MediaWiki\User\User\isBot().

Referenced by MediaWiki\Api\ApiEditPage\execute(), and MediaWiki\Api\ApiUpload\performUpload().

◆ setApiCode()

MediaWiki\Api\setApiCode ( $code,
?array $data = null )

◆ setApiData()

MediaWiki\Api\setApiData ( array $data)

Definition at line 143 of file ApiMessageTrait.php.

Referenced by MediaWiki\Api\setApiCode().

◆ setWatch()

MediaWiki\Api\setWatch ( string $watch,
PageIdentity $page,
User $user,
?string $userOption = null,
?string $expiry = null )
protected

Set a watch (or unwatch) based the based on a watchlist parameter.

Parameters
string$watchValid values: 'watch', 'unwatch', 'preferences', 'nochange'
PageIdentity$pageThe page to change
User$userThe user to set watch/unwatch for
string | null$userOptionThe user option to consider when $watch=preferences
string | null$expiryOptional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist.

Definition at line 95 of file ApiWatchlistTrait.php.

Referenced by MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiDelete\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiRollback\execute(), MediaWiki\Api\ApiUnblock\execute(), MediaWiki\Api\ApiUndelete\execute(), and MediaWiki\Api\ApiUserrights\execute().

Variable Documentation

◆ $apiCode

string null MediaWiki::Api\$apiCode = null
protected

◆ $apiData

array MediaWiki::Api\$apiData = []
protected

Definition at line 104 of file ApiMessageTrait.php.

Referenced by MediaWiki\Api\__serialize(), and MediaWiki\Api\getApiData().