r24228 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24227‎ | r24228 | r24229 >
Date:07:07, 18 July 2007
Author:robchurch
Status:old
Tags:
Comment:
Use a function in the global namespace as the hook; reports of the class method causing some odd problems with 1.9.x
Modified paths:
  • /trunk/extensions/NewUserNotif/NewUserNotif.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewUserNotif/NewUserNotif.php
@@ -40,12 +40,22 @@
4141 */
4242 function efNewUserNotifSetup() {
4343 global $wgHooks, $wgMessageCache;
44 - $wgHooks['AddNewAccount'][] = 'NewUserNotifier::hook';
 44+ $wgHooks['AddNewAccount'][] = 'efNewUserNotif';
4545 require_once( dirname( __FILE__ ) . '/NewUserNotif.i18n.php' );
4646 foreach( efNewUserNotifMessages() as $lang => $messages )
4747 $wgMessageCache->addMessages( $messages, $lang );
4848 }
4949
 50+ /**
 51+ * Hook account creation
 52+ *
 53+ * @param User $user User account that was created
 54+ * @return bool
 55+ */
 56+ function efNewUserNotif( $user ) {
 57+ return NewUserNotifier::hook( $user );
 58+ }
 59+
5060 } else {
5161 echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
5262 exit( 1 );

Status & tagging log