r76212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76211‎ | r76212 | r76213 >
Date:20:05, 6 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
Replaced remaining calls to userMailer() by UserMailer::send()
Modified paths:
  • /trunk/extensions/CategoryWatch/CategoryWatch.php (modified) (history)
  • /trunk/extensions/ContactPageFundraiser/SpecialContact.php (modified) (history)
  • /trunk/extensions/NewUserNotif/NewUserNotif.class.php (modified) (history)
  • /trunk/extensions/SemanticNotifyMe/includes/jobs/SMW_NMSendMailJob.php (modified) (history)
  • /trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php (modified) (history)
  • /trunk/extensions/Todo/Todo.php (modified) (history)
  • /trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryWatch/CategoryWatch.php
@@ -215,11 +215,7 @@
216216 # Replace keys, wrap text and send
217217 $body = strtr( $body, $keys );
218218 $body = wordwrap( $body, 72 );
219 - if ( function_exists( 'userMailer' ) ) {
220 - userMailer( $to, $from, $subject, $body, $replyto );
221 - } else {
222 - UserMailer::send( $to, $from, $subject, $body, $replyto );
223 - }
 219+ UserMailer::send( $to, $from, $subject, $body, $replyto );
224220 }
225221 }
226222
Index: trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php
@@ -53,7 +53,6 @@
5454
5555 function UW_GenericEditPage_emailSuggestion ( $category ) {
5656 global $wgSuggestCategoryRecipient, $wgEmergencyContact, $wgSitename, $wgUser;
57 - require_once ( "UserMailer.php" );
5857
5958 wfLoadExtensionMessages( 'GenericEditPage' );
6059
@@ -63,7 +62,7 @@
6463 $body = wfMsg ( "gep-emailbody", $wgUser->getName(), $category, $wgSitename );
6564
6665 // attempt to send the notification
67 - $result = userMailer ( $to, $from, $subj, $body );
 66+ $result = UserMailer::send( $to, $from, $subj, $body );
6867
6968 /* send a message back to the client, to let them
7069 * know if the suggestion was successfully sent (or not) */
Index: trunk/extensions/ContactPageFundraiser/SpecialContact.php
@@ -15,9 +15,6 @@
1616 die( 1 );
1717 }
1818
19 -global $IP; #needed when called from the autoloader
20 -require_once("$IP/includes/UserMailer.php");
21 -
2219 /**
2320 *
2421 */
@@ -320,7 +317,7 @@
321318
322319 $replyaddr = $replyto == null ? null : $replyto;
323320
324 - $mailResult = userMailer( $to, $from, $subject, $this->text, $replyaddr );
 321+ $mailResult = UserMailer::send( $to, $from, $subject, $this->text, $replyaddr );
325322
326323 if( WikiError::isError( $mailResult ) ) {
327324 $wgOut->addWikiText( wfMsg( "usermailererror" ) . $mailResult->getMessage());
@@ -332,7 +329,7 @@
333330 $cc_subject = wfMsg('emailccsubject', $this->target->getName(), $subject);
334331 if( wfRunHooks( 'ContactForm', array( &$from, &$replyto, &$cc_subject, &$this->text ) ) ) {
335332 wfDebug( "$fname: sending cc mail from ".$from->toString()." to ".$replyto->toString()."\n" );
336 - $ccResult = userMailer( $replyto, $from, $cc_subject, $this->text );
 333+ $ccResult = UserMailer::send( $replyto, $from, $cc_subject, $this->text );
337334 if( WikiError::isError( $ccResult ) ) {
338335 // At this stage, the user's CC mail has failed, but their
339336 // original mail has succeeded. It's unlikely, but still, what to do?
Index: trunk/extensions/Todo/Todo.php
@@ -445,7 +445,6 @@
446446 * @return mixed true on success, WikiError on failure
447447 */
448448 function sendConfirmationMail( $closeComment ) {
449 - require_once 'includes/UserMailer.php';
450449 global $wgContLang;
451450
452451 $owner = User::newFromId( $this->owner );
@@ -455,7 +454,7 @@
456455
457456 $sender = new MailAddress( $owner );
458457 $recipient = new MailAddress( $this->email );
459 - return userMailer( $recipient, $sender,
 458+ return UserMailer::send( $recipient, $sender,
460459 wfMsgForContent( 'todo-mail-subject', $owner->getName() ),
461460 wordwrap( wfMsgForContent( 'todo-mail-body',
462461 $owner->getName(),
Index: trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php
@@ -56,7 +56,7 @@
5757 $name = ( ( $user_info->user_real_name == '' ) ? $user_info->user_name:$user_info->user_real_name );
5858
5959 global $wgOutputEncoding;
60 - UserMailer::send( // userMailer(
 60+ UserMailer::send(
6161 new MailAddress( $user_info->user_email, $name ),
6262 new MailAddress( $wgEmergencyContact, 'Admin' ),
6363 wfMsg( 'smw_nm_hint_mail_title', $msg['title'], $wgSitename ),
Index: trunk/extensions/SemanticNotifyMe/includes/jobs/SMW_NMSendMailJob.php
@@ -10,10 +10,7 @@
1111 if ( !defined( 'MEDIAWIKI' ) ) {
1212 die( "This file is part of the Semantic NotifyMe Extension. It is not a valid entry point.\n" );
1313 }
14 -global $IP;
15 -require_once( "$IP/includes/JobQueue.php" );
1614
17 -
1815 class SMW_NMSendMailJob extends Job {
1916
2017 /**
@@ -37,7 +34,7 @@
3835 wfDebug( __METHOD__ );
3936 wfProfileIn( __METHOD__ );
4037
41 - UserMailer::send( // userMailer(
 38+ UserMailer::send(
4239 $this->params['to'],
4340 $this->params['from'],
4441 $this->params['subj'],
Index: trunk/extensions/NewUserNotif/NewUserNotif.class.php
@@ -8,8 +8,6 @@
99 * @author Rob Church <robchur@gmail.com>
1010 */
1111
12 -require_once( 'UserMailer.php' );
13 -
1412 class NewUserNotifier {
1513
1614 private $sender;
@@ -41,7 +39,7 @@
4240 private function sendExternalMails() {
4341 global $wgNewUserNotifEmailTargets, $wgNewUserNotifSenderParam, $wgNewUserNotifSenderSubjParam;
4442 foreach( $wgNewUserNotifEmailTargets as $target ) {
45 - userMailer(
 43+ UserMailer::send(
4644 new MailAddress( $target ),
4745 new MailAddress( $this->sender ),
4846 $this->makeMessage( $target, $this->user, 'newusernotifsubj', $wgNewUserNotifSenderSubjParam),

Follow-up revisions

RevisionCommit summaryAuthorDate
r76213added wfDeprecated() to wfRFC822Phrase() and userMailer(); tag for removal in...ialex20:10, 6 November 2010

Status & tagging log