Update wikimedia/password-blacklist to v0.1.4
[lhc/web/wiklou.git] / docs / hooks.txt
index 8223814..2f800a4 100644 (file)
@@ -240,13 +240,6 @@ MediaWiki 1.4rc1.
 This is a list of known events and parameters; please add to it if you're going
 to add events to the MediaWiki code.
 
-'AbortAutoAccount': DEPRECATED since 1.27! Create a PreAuthenticationProvider
-instead. Return false to cancel automated local account creation, where normally
-authentication against an external auth plugin would be creating a local
-account.
-$user: the User object about to be created (read-only, incomplete)
-&$abortMsg: out parameter: name of error message to be displayed to user
-
 'AbortAutoblock': Return false to cancel an autoblock.
 $autoblockip: The IP going to be autoblocked.
 &$block: The block from which the autoblock is coming.
@@ -259,25 +252,6 @@ $editor: The User who made the change.
 $title: The Title of the page that was edited.
 $rc: The current RecentChange object.
 
-'AbortLogin': DEPRECATED since 1.27! Create a PreAuthenticationProvider instead.
-Return false to cancel account login.
-$user: the User object being authenticated against
-$password: the password being submitted, not yet checked for validity
-&$retval: a LoginForm class constant to return from authenticateUserData();
-  default is LoginForm::ABORTED. Note that the client may be using a machine
-  API rather than the HTML user interface.
-&$msg: the message identifier for abort reason (new in 1.18, not available
-  before 1.18)
-
-'AbortNewAccount': DEPRECATED since 1.27! Create a PreAuthenticationProvider
-instead. Return false to cancel explicit account creation.
-$user: the User object about to be created (read-only, incomplete)
-&$msg: out parameter: HTML to display on abort
-&$status: out parameter: Status object to return, replaces the older $msg param
-  (added in 1.23)
-  Create the object with Status::newFatal() to ensure proper API error
-  messages are returned when creating account through API clients.
-
 'AbortTalkPageEmailNotification': Return false to cancel talk page email
 notification
 $targetUser: the user whom to send talk page email notification
@@ -415,21 +389,10 @@ $format: API format code for $text.
 &$params: Array of parameters
 $flags: int zero or OR-ed flags like ApiBase::GET_VALUES_FOR_HELP
 
-'APIGetDescription': DEPRECATED since 1.25! Use APIGetDescriptionMessages
-instead. Use this hook to modify a module's description.
-&$module: ApiBase Module object
-&$desc: String description, or array of description strings
-
 'APIGetDescriptionMessages': Use this hook to modify a module's help message.
 $module: ApiBase Module object
 &$msg: Array of Message objects
 
-'APIGetParamDescription': DEPRECATED since 1.25! Use
-APIGetParamDescriptionMessages instead.
-Use this hook to modify a module's parameter descriptions.
-&$module: ApiBase Module object
-&$desc: Array of parameter descriptions
-
 'APIGetParamDescriptionMessages': Use this hook to modify a module's parameter
 descriptions.
 $module: ApiBase Module object
@@ -473,6 +436,15 @@ can alter or append to the array.
       (url), 'width', 'height', 'alt', 'align'.
     - url: Url for the given title.
 
+'ApiOptions': Called by action=options before applying changes to user
+preferences.
+$apiModule: Calling ApiOptions object
+$user: User object whose preferences are being changed
+$changes: Associative array of preference name => value
+$resetKinds: Array of strings specifying which options kinds to reset.
+  See User::resetOptions() and User::getOptionKinds() for possible
+  values.
+
 'ApiParseMakeOutputPage': Called when preparing the OutputPage object for
 ApiParse. This is mainly intended for calling OutputPage::addContentOverride()
 or OutputPage::addContentOverrideCallback().
@@ -1015,16 +987,6 @@ $rows: The data that will be rendered. May be a ResultWrapper instance or
 $unpatrolled: Whether or not we are showing unpatrolled changes.
 $watched: Whether or not the change is watched by the user.
 
-'ChangesListSpecialPageFilters': DEPRECATED since 1.29! Use
-'ChangesListSpecialPageStructuredFilters' instead.
-Called after building form options on pages
-inheriting from ChangesListSpecialPage (in core: RecentChanges,
-RecentChangesLinked and Watchlist).
-$special: ChangesListSpecialPage instance
-&$filters: associative array of filter definitions. The keys are the HTML
-  name/URL parameters. Each key maps to an associative array with a 'msg'
-  (message key) and a 'default' value.
-
 'ChangesListSpecialPageQuery': Called when building SQL query on pages
 inheriting from ChangesListSpecialPage (in core: RecentChanges,
 RecentChangesLinked and Watchlist).
@@ -1395,19 +1357,6 @@ an article
 &$article: article (object) being viewed
 &$oldid: oldid (int) being viewed
 
-'DoEditSectionLink': DEPRECATED since 1.25! Use SkinEditSectionLinks instead.
-Override the HTML generated for section edit links
-$skin: Skin object rendering the UI
-$title: Title object for the title being linked to (may not be the same as
-  the page title, if the section is included from a template)
-$section: The designation of the section being pointed to, to be included in
-  the link, like "&section=$section"
-$tooltip: The default tooltip.  Escape before using.
-  By default, this is wrapped in the 'editsectionhint' message.
-&$result: The HTML to return, prefilled with the default plus whatever other
-  changes earlier hooks have made
-$lang: The language code to use for the link in the wfMessage function
-
 'EditFilter': Perform checks on an edit
 $editor: EditPage instance (object). The edit form (see includes/EditPage.php)
 $text: Contents of the edit box
@@ -1494,11 +1443,10 @@ textarea in the edit form.
 &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff"
 &$tabindex: HTML tabindex of the last edit check/button
 
-'EditPageBeforeEditToolbar': Allows modifying the edit toolbar above the
-textarea in the edit form.
-Hook subscribers can return false to avoid the default toolbar code being
-loaded.
-&$toolbar: The toolbar HTML
+'EditPageBeforeEditToolbar': Allow adding an edit toolbar above the textarea in
+the edit form.
+&$toolbar: The toolbar HTML, initially an empty `<div id="toolbar"></div>`
+Hook subscribers can return false to have no toolbar HTML be loaded.
 
 'EditPageCopyrightWarning': Allow for site and per-namespace customization of
 contribution/copyright notice.
@@ -1787,6 +1735,7 @@ $out: OutputPage object (to check what type of page the user is on)
 'GetPreferences': Modify user preferences.
 $user: User whose preferences are being modified.
 &$preferences: Preferences description array, to be fed to an HTMLForm object
+$context: IContextSource object (added in 1.33)
 
 'GetRelativeTimestamp': Pre-emptively override the relative timestamp generated
 by MWTimestamp::getRelativeTimestamp(). Return false in this hook to use the
@@ -2014,23 +1963,11 @@ $user: User the password is being validated for
 $code: The language code or the language we're looking for a messages file for
 &$file: The messages file path, you can override this to change the location.
 
-'LanguageGetMagic': DEPRECATED since 1.16! Use $magicWords in a file listed in
-$wgExtensionMessagesFiles instead.
-Use this to define synonyms of magic words depending of the language
-&$magicExtensions: associative array of magic words synonyms
-$lang: language code (string)
-
 'LanguageGetNamespaces': Provide custom ordering for namespaces or
 remove namespaces. Do not use this hook to add namespaces. Use
 CanonicalNamespaces for that.
 &$namespaces: Array of namespaces indexed by their numbers
 
-'LanguageGetSpecialPageAliases': DEPRECATED! Use $specialPageAliases in a file
-listed in $wgExtensionMessagesFiles instead.
-Use to define aliases of special pages names depending of the language
-&$specialPageAliases: associative array of magic words synonyms
-$lang: language code (string)
-
 'LanguageGetTranslatedLanguageNames': Provide translated language names.
 &$names: array of language code => language name
 $code: language of the preferred translations
@@ -2250,15 +2187,6 @@ in LoginForm::$validErrorMessages).
 &$messages: Already added messages (inclusive messages from
   LoginForm::$validErrorMessages)
 
-'LoginUserMigrated': DEPRECATED since 1.27! Create a PreAuthenticationProvider
-instead. Called during login to allow extensions the opportunity to inform a
-user that their username doesn't exist for a specific reason, instead of letting
-the login form give the generic error message that the account does not exist.
-For example, when the account has been renamed or deleted.
-$user: the User object being authenticated against.
-&$msg: the message identifier for abort reason, or an array to pass a message
-  key and parameters.
-
 'LogLine': Processes a single log entry on Special:Log.
 $log_type: string for the type of log entry (e.g. 'move'). Corresponds to
   logging.log_type database field.
@@ -2353,7 +2281,7 @@ $title: title of the message (string)
 $code: code (string) denoting the language to try.
 
 'MimeMagicGuessFromContent': Allows MW extensions guess the MIME by content.
-$mimeMagic: Instance of MimeMagic.
+$mimeMagic: Instance of MimeAnalyzer.
 &$head: First 1024 bytes of the file in a string (in - Do not alter!).
 &$tail: More or equal than last 65558 bytes of the file in a string
   (in - Do not alter!).
@@ -2362,7 +2290,7 @@ $file: File path.
 
 'MimeMagicImproveFromExtension': Allows MW extensions to further improve the
 MIME type detected by considering the file extension.
-$mimeMagic: Instance of MimeMagic.
+$mimeMagic: Instance of MimeAnalyzer.
 $ext: File extension.
 &$mime: MIME type (in/out).
 
@@ -2370,7 +2298,7 @@ $ext: File extension.
 and the list mapping MIME types to file extensions.
 As an extension author, you are encouraged to submit patches to MediaWiki's
 core to add new MIME types to mime.types.
-$mimeMagic: Instance of MimeMagic.
+$mimeMagic: Instance of MimeAnalyzer.
   Use $mimeMagic->addExtraInfo( $stringOfInfo );
   for adding new MIME info to the list.
   Use $mimeMagic->addExtraTypes( $stringOfTypes );
@@ -2670,13 +2598,6 @@ cache or return false to not use it.
 &$parser: Parser object
 &$varCache: variable cache (array)
 
-'ParserLimitReport': DEPRECATED since 1.22! Use ParserLimitReportPrepare and
-ParserLimitReportFormat instead.
-Called at the end of Parser:parse() when the parser will
-include comments about size of the text parsed.
-$parser: Parser object
-&$limitReport: text that will be included (without comment tags)
-
 'ParserLimitReportFormat': Called for each row in the parser limit report that
 needs formatting. If nothing handles this hook, the default is to use "$key" to
 get the label, and "$key-value" or "$key-value-text"/"$key-value-html" to
@@ -2898,7 +2819,9 @@ $context: ResourceLoaderContext|null
 ResourceLoaderStartUpModule::getConfigSettings(). Use this to export static
 configuration variables to JavaScript. Things that depend on the current page
 or request state must be added through MakeGlobalVariablesScript instead.
+Skin is made available for skin specific config.
 &$vars: [ variable name => value ]
+$skin: Skin
 
 'ResourceLoaderJqueryMsgModuleMagicWords': Called in
 ResourceLoaderJqueryMsgModule to allow adding magic words for jQueryMsg.
@@ -3338,17 +3261,6 @@ SpecialRecentChanges.
 &$extraOpts: array of added items, to which can be added
 $opts: FormOptions for this request
 
-'SpecialRecentChangesQuery': DEPRECATED since 1.23! Use
-ChangesListSpecialPageStructuredFilters or ChangesListSpecialPageQuery instead.
-Called when building SQL query for SpecialRecentChanges and
-SpecialRecentChangesLinked.
-&$conds: array of WHERE conditionals for query
-&$tables: array of tables to be queried
-&$join_conds: join conditions for the tables
-$opts: FormOptions for this request
-&$query_options: array of options for the database request
-&$select: Array of columns to select
-
 'SpecialResetTokensTokens': Called when building token list for
 SpecialResetTokens.
 &$tokens: array of token information arrays in the format of
@@ -3452,15 +3364,6 @@ SpecialWatchlist. Allows extensions to register custom values they have
 inserted to rc_type so they can be returned as part of the watchlist.
 &$nonRevisionTypes: array of values in the rc_type field of recentchanges table
 
-'SpecialWatchlistQuery': DEPRECATED since 1.23! Use
-ChangesListSpecialPageStructuredFilters or ChangesListSpecialPageQuery instead.
-Called when building sql query for SpecialWatchlist.
-&$conds: array of WHERE conditionals for query
-&$tables: array of tables to be queried
-&$join_conds: join conditions for the tables
-&$fields: array of query fields
-$opts: A FormOptions object with watchlist options for the current request
-
 'TestCanonicalRedirect': Called when about to force a redirect to a canonical
 URL for a title when we have no other parameters on the URL. Gives a chance for
 extensions that alter page view behavior radically to abort that redirect or
@@ -3515,6 +3418,9 @@ $title: Title object that is being checked
 $old: old title
 $nt: new title
 $user: user who does the move
+$reason: string of the reason provided by the user
+&$status: Status object. To abort the move, add a fatal error to this object
+       (i.e. call $status->fatal()).
 
 'TitleMoveStarting': Before moving an article (title), but just after the atomic
 DB section starts.
@@ -3603,12 +3509,6 @@ Since 1.24: Paths pointing to a directory will be recursively scanned for
 test case files matching the suffix "Test.php".
 &$paths: list of test cases and directories to search.
 
-'UnknownAction': DEPRECATED since 1.19! To add an action in an extension,
-create a subclass of Action, and add a new key to $wgActions.
-An unknown "action" has occurred (useful for defining your own actions).
-$action: action name
-$article: article "acted on"
-
 'UnwatchArticle': Before a watch is removed from an article.
 &$user: user watching
 &$page: WikiPage object to be removed
@@ -3739,10 +3639,6 @@ messages!" message, return false to not delete it.
 &$user: User (object) that will clear the message
 $oldid: ID of the talk page revision being viewed (0 means the most recent one)
 
-'UserCreateForm': DEPRECATED since 1.27! Create an AuthenticationProvider
-instead. Manipulate the login form.
-&$template: SimpleTemplate instance for the form
-
 'UserEffectiveGroups': Called in User::getEffectiveGroups().
 &$user: User to get groups for
 &$groups: Current effective groups
@@ -3767,10 +3663,6 @@ $user: User object
 &$timestamp: timestamp, change this to override local email authentication
   timestamp
 
-'UserGetImplicitGroups': DEPRECATED since 1.25!
-Called in User::getImplicitGroups().
-&$groups: List of implicit (automatically-assigned) groups
-
 'UserGetLanguageObject': Called when getting user's interface language object.
 $user: User object
 &$code: Language code that will be used to create the object
@@ -3783,6 +3675,13 @@ $context: IContextSource object
 $user: User to get rights for
 &$rights: Current rights
 
+'UserGetRightsRemove': Called in User::getRights(). This hook override
+the UserGetRights hook. It can be used to remove rights from user
+and ensure that will not be reinserted by the other hook callbacks
+therefore this hook should not be used to add any rights, use UserGetRights instead.
+$user: User to get rights for
+&$rights: Current rights
+
 'UserGroupsChanged': Called after user groups are changed.
 $user: User whose groups changed
 $added: Groups added
@@ -3858,10 +3757,6 @@ $direct: (bool) The hook is called directly after a successful login. This will
   only happen once per login. A UserLoginComplete call with direct=false can
   happen when the user visits the login page while already logged in.
 
-'UserLoginForm': DEPRECATED since 1.27! Create an AuthenticationProvider
-instead. Manipulate the login form.
-&$template: QuickTemplate instance for the form
-
 'UserLogout': Before a user logs out.
 &$user: the user object that is about to be logged out