Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libs/Zend/Mail/Transport/Sendmail.php')
-rw-r--r--libs/Zend/Mail/Transport/Sendmail.php75
1 files changed, 14 insertions, 61 deletions
diff --git a/libs/Zend/Mail/Transport/Sendmail.php b/libs/Zend/Mail/Transport/Sendmail.php
index c12eb46a23..cef1e2091f 100644
--- a/libs/Zend/Mail/Transport/Sendmail.php
+++ b/libs/Zend/Mail/Transport/Sendmail.php
@@ -11,20 +11,20 @@
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
- *
+ *
* @category Zend
* @package Zend_Mail
* @subpackage Transport
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: Sendmail.php 21605 2010-03-22 15:09:03Z yoshida@zend.co.jp $
+ * @version $Id: Sendmail.php 18264 2009-09-18 18:25:38Z beberlei $
*/
/**
* @see Zend_Mail_Transport_Abstract
*/
-// require_once 'Zend/Mail/Transport/Abstract.php';
+require_once 'Zend/Mail/Transport/Abstract.php';
/**
@@ -33,7 +33,7 @@
* @category Zend
* @package Zend_Mail
* @subpackage Transport
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
@@ -53,6 +53,7 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
*/
public $parameters;
+
/**
* EOL character string
* @var string
@@ -60,28 +61,15 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
*/
public $EOL = PHP_EOL;
- /**
- * error information
- * @var string
- */
- protected $_errstr;
/**
* Constructor.
*
- * @param string|array|Zend_Config $parameters OPTIONAL (Default: null)
+ * @param string $parameters OPTIONAL (Default: null)
* @return void
*/
public function __construct($parameters = null)
{
- if ($parameters instanceof Zend_Config) {
- $parameters = $parameters->toArray();
- }
-
- if (is_array($parameters)) {
- $parameters = implode(' ', $parameters);
- }
-
$this->parameters = $parameters;
}
@@ -91,50 +79,30 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
*
* @access public
* @return void
- * @throws Zend_Mail_Transport_Exception if parameters is set
- * but not a string
* @throws Zend_Mail_Transport_Exception on mail() failure
*/
public function _sendMail()
{
if ($this->parameters === null) {
- set_error_handler(array($this, '_handleMailErrors'));
$result = mail(
$this->recipients,
$this->_mail->getSubject(),
$this->body,
$this->header);
- restore_error_handler();
} else {
- if(!is_string($this->parameters)) {
- /**
- * @see Zend_Mail_Transport_Exception
- *
- * Exception is thrown here because
- * $parameters is a public property
- */
- // require_once 'Zend/Mail/Transport/Exception.php';
- throw new Zend_Mail_Transport_Exception(
- 'Parameters were set but are not a string'
- );
- }
-
- set_error_handler(array($this, '_handleMailErrors'));
$result = mail(
$this->recipients,
$this->_mail->getSubject(),
$this->body,
$this->header,
$this->parameters);
- restore_error_handler();
}
-
- if ($this->_errstr !== null || !$result) {
+ if (!$result) {
/**
* @see Zend_Mail_Transport_Exception
*/
- // require_once 'Zend/Mail/Transport/Exception.php';
- throw new Zend_Mail_Transport_Exception('Unable to send mail. ' . $this->_errstr);
+ require_once 'Zend/Mail/Transport/Exception.php';
+ throw new Zend_Mail_Transport_Exception('Unable to send mail');
}
}
@@ -157,7 +125,7 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
/**
* @see Zend_Mail_Transport_Exception
*/
- // require_once 'Zend/Mail/Transport/Exception.php';
+ require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception('_prepareHeaders requires a registered Zend_Mail object');
}
@@ -169,7 +137,7 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
/**
* @see Zend_Mail_Transport_Exception
*/
- // require_once 'Zend/Mail/Transport/Exception.php';
+ require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception('Missing To addresses');
}
} else {
@@ -178,7 +146,7 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
/**
* @see Zend_Mail_Transport_Exception
*/
- // require_once 'Zend/Mail/Transport/Exception.php';
+ require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception('Missing To header');
}
@@ -201,20 +169,5 @@ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
$this->header = rtrim($this->header);
}
- /**
- * Temporary error handler for PHP native mail().
- *
- * @param int $errno
- * @param string $errstr
- * @param string $errfile
- * @param string $errline
- * @param array $errcontext
- * @return true
- */
- public function _handleMailErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)
- {
- $this->_errstr = $errstr;
- return true;
- }
-
}
+