Merge "Add instrumentation to Special:Mute"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 20 Aug 2019 17:34:29 +0000 (17:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 20 Aug 2019 17:34:29 +0000 (17:34 +0000)
1  2 
docs/hooks.txt

diff --combined docs/hooks.txt
@@@ -91,29 -91,23 +91,29 @@@ title-reversing if-blocks spread all ov
  deleteAnArticle, exportArticle, etc., we can concentrate it all in an extension
  file:
  
 -      function reverseArticleTitle( $article ) {
 +      function onArticleShow( &$article ) {
                # ...
        }
  
 -      function reverseForExport( $article ) {
 +      function onArticleDelete( &$article ) {
                # ...
        }
  
 -The setup function for the extension just has to add its hook functions to the
 -appropriate events:
 -
 -      setupTitleReversingExtension() {
 -              global $wgHooks;
 +      function onArticleExport( &$article ) {
 +              # ...
 +      }
  
 -              $wgHooks['ArticleShow'][] = 'reverseArticleTitle';
 -              $wgHooks['ArticleDelete'][] = 'reverseArticleTitle';
 -              $wgHooks['ArticleExport'][] = 'reverseForExport';
 +General practice is to have a dedicated file for functions activated by hooks,
 +which functions named 'onHookName'. In the example above, the file
 +'ReverseHooks.php' includes the functions that should be activated by the
 +'ArticleShow', 'ArticleDelete', and 'ArticleExport' hooks. The 'extension.json'
 +file with the extension's registration just has to add its hook functions
 +to the appropriate events:
 +
 +      "Hooks": {
 +              "ArticleShow": "ReverseHooks:onArticleShow",
 +              "ArticleDelete": "ReverseHooks::onArticleDelete",
 +              "ArticleExport": "ReverseHooks::onArticleExport"
        }
  
  Having all this code related to the title-reversion option in one place means
@@@ -3211,6 -3205,9 +3211,9 @@@ $request: WebRequest object for gettin
  $sp: SpecialPage object, for context
  &$fields: Current HTMLForm fields descriptors
  
+ 'SpecialMuteSubmit': DEPRECATED since 1.34! Used only for instrumentation on SpecialMute
+ $data: Array containing information about submitted options on SpecialMute form
  'SpecialNewpagesConditions': Called when building sql query for
  Special:NewPages.
  &$special: NewPagesPager object (subclass of ReverseChronologicalPager)