http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76212

Revision: 76212
Author:   ialex
Date:     2010-11-06 20:05:13 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
Replaced remaining calls to userMailer() by UserMailer::send()

Modified Paths:
--------------
    trunk/extensions/CategoryWatch/CategoryWatch.php
    trunk/extensions/ContactPageFundraiser/SpecialContact.php
    trunk/extensions/NewUserNotif/NewUserNotif.class.php
    trunk/extensions/SemanticNotifyMe/includes/jobs/SMW_NMSendMailJob.php
    
trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php
    trunk/extensions/Todo/Todo.php
    trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php

Modified: trunk/extensions/CategoryWatch/CategoryWatch.php
===================================================================
--- trunk/extensions/CategoryWatch/CategoryWatch.php    2010-11-06 19:37:32 UTC 
(rev 76211)
+++ trunk/extensions/CategoryWatch/CategoryWatch.php    2010-11-06 20:05:13 UTC 
(rev 76212)
@@ -215,11 +215,7 @@
                                # Replace keys, wrap text and send
                                $body = strtr( $body, $keys );
                                $body = wordwrap( $body, 72 );
-                               if ( function_exists( 'userMailer' ) ) {
-                                       userMailer( $to, $from, $subject, 
$body, $replyto );
-                               } else {
-                                       UserMailer::send( $to, $from, $subject, 
$body, $replyto );
-                               }
+                               UserMailer::send( $to, $from, $subject, $body, 
$replyto );
                        }
                }
 

Modified: trunk/extensions/ContactPageFundraiser/SpecialContact.php
===================================================================
--- trunk/extensions/ContactPageFundraiser/SpecialContact.php   2010-11-06 
19:37:32 UTC (rev 76211)
+++ trunk/extensions/ContactPageFundraiser/SpecialContact.php   2010-11-06 
20:05:13 UTC (rev 76212)
@@ -15,9 +15,6 @@
        die( 1 );
 }
 
-global $IP; #needed when called from the autoloader
-require_once("$IP/includes/UserMailer.php");
-
 /**
  *
  */
@@ -320,7 +317,7 @@
 
                        $replyaddr = $replyto == null ? null : $replyto;
 
-                       $mailResult = userMailer( $to, $from, $subject, 
$this->text, $replyaddr );
+                       $mailResult = UserMailer::send( $to, $from, $subject, 
$this->text, $replyaddr );
 
                        if( WikiError::isError( $mailResult ) ) {
                                $wgOut->addWikiText( wfMsg( "usermailererror" ) 
. $mailResult->getMessage());
@@ -332,7 +329,7 @@
                                        $cc_subject = wfMsg('emailccsubject', 
$this->target->getName(), $subject);
                                        if( wfRunHooks( 'ContactForm', array( 
&$from, &$replyto, &$cc_subject, &$this->text ) ) ) {
                                                wfDebug( "$fname: sending cc 
mail from ".$from->toString()." to ".$replyto->toString()."\n" );
-                                               $ccResult = userMailer( 
$replyto, $from, $cc_subject, $this->text );
+                                               $ccResult = UserMailer::send( 
$replyto, $from, $cc_subject, $this->text );
                                                if( WikiError::isError( 
$ccResult ) ) {
                                                        // At this stage, the 
user's CC mail has failed, but their
                                                        // original mail has 
succeeded. It's unlikely, but still, what to do?

Modified: trunk/extensions/NewUserNotif/NewUserNotif.class.php
===================================================================
--- trunk/extensions/NewUserNotif/NewUserNotif.class.php        2010-11-06 
19:37:32 UTC (rev 76211)
+++ trunk/extensions/NewUserNotif/NewUserNotif.class.php        2010-11-06 
20:05:13 UTC (rev 76212)
@@ -8,8 +8,6 @@
  * @author Rob Church <[email protected]>
  */
 
-require_once( 'UserMailer.php' );
-
 class NewUserNotifier {
 
        private $sender;
@@ -41,7 +39,7 @@
        private function sendExternalMails() {
                global $wgNewUserNotifEmailTargets, $wgNewUserNotifSenderParam, 
$wgNewUserNotifSenderSubjParam;
                foreach( $wgNewUserNotifEmailTargets as $target ) {
-                       userMailer(
+                       UserMailer::send(
                                new MailAddress( $target ),
                                new MailAddress( $this->sender ),
                                $this->makeMessage( $target, $this->user, 
'newusernotifsubj', $wgNewUserNotifSenderSubjParam),

Modified: trunk/extensions/SemanticNotifyMe/includes/jobs/SMW_NMSendMailJob.php
===================================================================
--- trunk/extensions/SemanticNotifyMe/includes/jobs/SMW_NMSendMailJob.php       
2010-11-06 19:37:32 UTC (rev 76211)
+++ trunk/extensions/SemanticNotifyMe/includes/jobs/SMW_NMSendMailJob.php       
2010-11-06 20:05:13 UTC (rev 76212)
@@ -10,10 +10,7 @@
 if ( !defined( 'MEDIAWIKI' ) ) {
   die( "This file is part of the Semantic NotifyMe Extension. It is not a 
valid entry point.\n" );
 }
-global $IP;
-require_once( "$IP/includes/JobQueue.php" );
 
-
 class SMW_NMSendMailJob extends Job {
 
        /**
@@ -37,7 +34,7 @@
                wfDebug( __METHOD__ );
                wfProfileIn( __METHOD__ );
 
-               UserMailer::send( // userMailer(
+               UserMailer::send(
                        $this->params['to'],
                        $this->params['from'],
                        $this->params['subj'],

Modified: 
trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php
===================================================================
--- 
trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php  
    2010-11-06 19:37:32 UTC (rev 76211)
+++ 
trunk/extensions/SemanticNotifyMe/specials/SMWNotifyMe/SMW_NMSendMailAsync.php  
    2010-11-06 20:05:13 UTC (rev 76212)
@@ -56,7 +56,7 @@
                $name = ( ( $user_info->user_real_name == '' ) ? 
$user_info->user_name:$user_info->user_real_name );
 
                global $wgOutputEncoding;
-               UserMailer::send( // userMailer(
+               UserMailer::send(
                        new MailAddress( $user_info->user_email, $name ),
                        new MailAddress( $wgEmergencyContact, 'Admin' ),
                        wfMsg( 'smw_nm_hint_mail_title', $msg['title'], 
$wgSitename ),

Modified: trunk/extensions/Todo/Todo.php
===================================================================
--- trunk/extensions/Todo/Todo.php      2010-11-06 19:37:32 UTC (rev 76211)
+++ trunk/extensions/Todo/Todo.php      2010-11-06 20:05:13 UTC (rev 76212)
@@ -445,7 +445,6 @@
         * @return mixed true on success, WikiError on failure
         */
        function sendConfirmationMail( $closeComment ) {
-               require_once 'includes/UserMailer.php';
                global $wgContLang;
 
                $owner = User::newFromId( $this->owner );
@@ -455,7 +454,7 @@
 
                $sender = new MailAddress( $owner );
                $recipient = new MailAddress( $this->email );
-               return userMailer( $recipient, $sender,
+               return UserMailer::send( $recipient, $sender,
                        wfMsgForContent( 'todo-mail-subject', $owner->getName() 
),
                        wordwrap( wfMsgForContent( 'todo-mail-body',
                                $owner->getName(),

Modified: trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php
===================================================================
--- trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php        
2010-11-06 19:37:32 UTC (rev 76211)
+++ trunk/extensions/uniwiki/GenericEditPage/GenericEditPage.php        
2010-11-06 20:05:13 UTC (rev 76212)
@@ -53,7 +53,6 @@
 
 function UW_GenericEditPage_emailSuggestion ( $category ) {
        global $wgSuggestCategoryRecipient, $wgEmergencyContact, $wgSitename, 
$wgUser;
-       require_once ( "UserMailer.php" );
 
        wfLoadExtensionMessages( 'GenericEditPage' );
 
@@ -63,7 +62,7 @@
        $body = wfMsg ( "gep-emailbody", $wgUser->getName(), $category, 
$wgSitename );
 
        // attempt to send the notification
-       $result = userMailer ( $to, $from, $subj, $body );
+       $result = UserMailer::send( $to, $from, $subj, $body );
 
        /* send a message back to the client, to let them
         * know if the suggestion was successfully sent (or not) */


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to