Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other...
[lhc/web/wiklou.git] / docs / hooks.txt
index 4687a27..e5ffb0f 100644 (file)
@@ -569,6 +569,9 @@ $user: the user who did the block (not the one being blocked)
 'BookInformation': Before information output on Special:Booksources
 $isbn: ISBN to show information for
 $output: OutputPage object in use
+
+'CanonicalNamespaces': For extensions adding their own namespaces or altering the defaults
+&$namespaces: Array of namespace numbers with corresponding canonical names
  
 'CategoryPageView': before viewing a categorypage in CategoryPage::view
 $catpage: CategoryPage instance
@@ -660,7 +663,7 @@ pages
 $editPage: EditPage    object
 
 'EditPage::attemptSave': called before an article is
-saved, that is before Article::doEdit() is called
+saved, that is before insertNewArticle() is called
 $editpage_Obj: the current EditPage object
 
 'EditPage::importFormData': allow extensions to read additional data
@@ -785,6 +788,8 @@ $reason: reason
 
 'FileUpload': When a file upload occurs
 $file : Image object representing the file that was uploaded
+$reupload : Boolean indicating if there was a previously another image there or not (since 1.17)
+$hasDescription : Boolean indicating that there was already a description page and a new one from the comment wasn't created (since 1.17)
 
 'FileUndeleteComplete': When a file is undeleted
 $title: title object to the file
@@ -821,6 +826,9 @@ $title: Title object of page
 $url: string value as output (out parameter, can modify)
 $query: query options passed to Title::getInternalURL()
 
+'GetIP': modify the ip of the current user (called only once)
+&$ip: string holding the ip as determined so far
+
 'GetLinkColours': modify the CSS class of an array of page links
 $linkcolour_ids: array of prefixed DB keys of the pages linked to,
        indexed by page_id.
@@ -850,10 +858,6 @@ $result: User permissions error to add. If none, return true.
 'getUserPermissionsErrorsExpensive': Absolutely the same, but is called only
        if expensive checks are enabled.
 
-'HTMLCacheUpdate::doUpdate': After cache invalidation updates are inserted
-into the job queue.
-$title: Title object, pages linked to this title are purged.
-
 'ImageBeforeProduceHTML': Called before producing the HTML created by a wiki
        image insertion.  You can skip the default logic entirely by returning
        false, or just modify a few things using call-by-reference.
@@ -1031,8 +1035,8 @@ completed
 'ListDefinedTags': When trying to find all defined tags.
 &$tags: The list of tags.
 
-'LoadExtensionSchemaUpdates': called by maintenance/updaters.inc when upgrading
-database schema
+'LoadExtensionSchemaUpdates': called during database installation and updates
+&updater: A DatabaseUpdater subclass
 
 'LocalFile::getHistory': called before file history query performed
 $file: the file
@@ -1185,6 +1189,14 @@ the resulting HTML is about to be displayed.
 $parserOutput: the parserOutput (object) that corresponds to the page
 $text: the text that will be displayed, in HTML (string)
 
+'OutputPageBodyAttributes': called when OutputPage::headElement is creating the body
+tag to allow for extensions to add attributes to the body of the page they might
+need. Or to allow building extensions to add body classes that aren't of high
+enough demand to be included in core.
+$out: The OutputPage which called the hook, can be used to get the real title
+$sk: The Skin that called OutputPage::headElement
+&$bodyAttrs: An array of attributes for the body tag passed to Html::openElement
+
 'OutputPageCheckLastModified': when checking if the page has been modified
 since the last visit
 &$modifiedTimes: array of timestamps.
@@ -1329,6 +1341,10 @@ $errorMsg: an html message string of an error
 $article: the page the form is shown for
 $out: OutputPage object
 
+'ResourceLoaderRegisterModules': Right before modules information is required, such as when responding to a resource
+loader request or generating HTML output.
+&$resourceLoader: ResourceLoader object
+
 'RawPageViewBeforeOutput': Right before the text is blown out in action=raw
 &$obj: RawPage object
 &$text: The text that's going to be the output
@@ -1416,6 +1432,7 @@ Append to $text to add additional text/scripts after the stock bottom scripts.
 'SkinAfterContent': Allows extensions to add text after the page content and
 article metadata.
 &$data: (string) Text to be printed out directly (without parsing)
+$skin: Skin object
 This hook should work in all skins. Just set the &$data variable to the text
 you're going to add.
 
@@ -1429,10 +1446,11 @@ $title: displayed page title
 $type: 'normal' or 'history' for old/diff views
 &$msg: overridable message; usually 'copyright' or 'history_copyright'. This message must be in HTML format, not wikitext!
 &$link: overridable HTML link to be passed into the message as $1
+&$forContent: overridable flag if copyright footer is shown in content language. 
 
 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle()
-$skin: Skin object
 &$subpages: Subpage links HTML
+$skin: Skin object
 If false is returned $subpages will be used instead of the HTML
 subPageSubtitle() generates.
 If true is returned, $subpages will be ignored and the rest of
@@ -1553,12 +1571,13 @@ SpecialRecentChanges
 $opts: FormOptions for this request
 
 'SpecialRecentChangesQuery': called when building sql query for
-SpecialRecentChanges
+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: String '*' or array of columns to select
 
 'SpecialSearchGomatch': called when user clicked the "Go" button and the target
 exists
@@ -1666,7 +1685,8 @@ $descriptor: (array) the HTMLForm descriptor
 added to the descriptor
 $descriptor: (array) the HTMLForm descriptor
 
-'UploadVerification': additional chances to reject an uploaded file
+'UploadVerification': additional chances to reject an uploaded file. Consider 
+                      using UploadVerifyFile instead.
 string $saveName: destination file name
 string $tempName: filesystem path to the temporary file for checks
 string &$error: output: message key for message to show if upload canceled 
@@ -1674,6 +1694,16 @@ string &$error: output: message key for message to show if upload canceled
        is the message key and the remaining elements are used as parameters to
        the message.
 
+'UploadVerifyFile': extra file verification, based on mime type, etc. Preferred
+                    in most cases over UploadVerification.
+object $upload: an instance of UploadBase, with all info about the upload
+string $mime: the uploaded file's mime type, as detected by MediaWiki. Handlers 
+       will typically only apply for specific mime types.
+object &$error: output: true if the file is valid. Otherwise, an indexed array
+       representing the problem with the file, where the first element
+       is the message key and the remaining elements are used as parameters to
+       the message.
+
 'UploadComplete': Upon completion of a file upload
 $uploadBase: UploadBase (or subclass) object. File can be accessed by
        $uploadBase->getLocalFile().
@@ -1839,10 +1869,6 @@ $user: User object
 &$timestamp: new timestamp, change this to override local email
 authentification timestamp
 
-'UserToggles': called when initialising User::$mToggles, use this to add
-new toggles
-$toggles: array of toggles to add
-
 'WantedPages::getSQL': called in WantedPagesPage::getSQL(), can be used to
 alter the SQL query which gets the list of wanted pages
 &$wantedPages: WantedPagesPage object