From: Jan Schneider Date: Fri, 31 Jul 2009 12:03:24 +0000 (+0200) Subject: Simplify specifying the mailer configuration. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=84eae422820e9eb3a84dc83f695ba729a1b4737f;p=horde.git Simplify specifying the mailer configuration. --- diff --git a/framework/Auth/lib/Horde/Auth/Signup.php b/framework/Auth/lib/Horde/Auth/Signup.php index 1031abe34..6840eb7bd 100644 --- a/framework/Auth/lib/Horde/Auth/Signup.php +++ b/framework/Auth/lib/Horde/Auth/Signup.php @@ -134,7 +134,7 @@ class Horde_Auth_Signup $conf['signup']['email'], $conf['signup']['email'], Horde_Nls::getCharset()); - $mail->send($conf['mailer']['type'], $conf['mailer']['params']); + $mail->send(Horde::getMailerConfig()); } } diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 508c47ba6..83e23a016 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -897,7 +897,7 @@ HTML; $mail_params['password'] = Horde_Auth::getCredential('password'); } - return array($mail_driver, $mail_params); + return array('type' => $mail_driver, 'params' => $mail_params); } /** diff --git a/framework/Mime/lib/Horde/Mime/Mail.php b/framework/Mime/lib/Horde/Mime/Mail.php index 847295afb..aecac7391 100644 --- a/framework/Mime/lib/Horde/Mime/Mail.php +++ b/framework/Mime/lib/Horde/Mime/Mail.php @@ -407,16 +407,16 @@ class Horde_Mime_Mail * documentation. * @link http://pear.php.net/Mail * - * @param string $driver The Mail driver to use. - * @param array $params Any parameters necessary for the Mail driver. + * @param array $config A hash with the Mail driver to use in 'type' and + * any parameters necessary for the Mail driver in + * 'params'. * @param boolean $resend If true, the message id and date are re-used; * If false, they will be updated. * @param boolean $flowed Send message in flowed text format. * * @throws Horde_Mime_Exception */ - public function send($driver = null, $params = array(), $resend = false, - $flowed = true) + public function send($config, $resend = false, $flowed = true) { /* Add mandatory headers if missing. */ if (!$resend || !$this->_headers->getValue('Message-ID')) { @@ -470,11 +470,11 @@ class Horde_Mime_Mail } /* Check mailer configuration. */ - if (!empty($driver)) { - $this->_mailer_driver = $driver; + if (!empty($config['type'])) { + $this->_mailer_driver = $config['type']; } - if (!empty($params)) { - $this->_mailer_params = $params; + if (!empty($config['params'])) { + $this->_mailer_params = $config['params']; } /* Send message. */ diff --git a/framework/Release/lib/Horde/Release.php b/framework/Release/lib/Horde/Release.php index f93b2989d..f2157c553 100644 --- a/framework/Release/lib/Horde/Release.php +++ b/framework/Release/lib/Horde/Release.php @@ -653,7 +653,7 @@ class Horde_Release $mail = new Horde_Mime_Mail(); $mail->setBody($body, 'iso-8859-1', false); $mail->addHeaders($headers); - $result = $mail->send($this->_options['mailer']['type'], $this->_options['mailer']['params']); + $result = $mail->send(array('type' => $this->_options['mailer']['type'], 'params' => $this->_options['mailer']['params'])); if (is_a($result, 'PEAR_Error')) { print $result->getMessage() . "\n"; }