import v1.1.0_RC2 | 2009-09-20

This commit is contained in:
2019-07-17 22:19:00 +02:00
parent 3b7ba80568
commit 38c146901c
2504 changed files with 101817 additions and 62316 deletions

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Log
* @subpackage Writer
* @copyright Copyright (c) 2005-2008 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: Mail.php 13626 2009-01-14 18:24:57Z matthew $
* @version $Id: Mail.php 16219 2009-06-21 19:45:39Z thomas $
*/
/** Zend_Log_Writer_Abstract */
@ -39,9 +39,9 @@ require_once 'Zend/Log/Formatter/Simple.php';
* @category Zend
* @package Zend_Log
* @subpackage Writer
* @copyright Copyright (c) 2005-2008 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: Mail.php 13626 2009-01-14 18:24:57Z matthew $
* @version $Id: Mail.php 16219 2009-06-21 19:45:39Z thomas $
*/
class Zend_Log_Writer_Mail extends Zend_Log_Writer_Abstract
{
@ -245,17 +245,34 @@ class Zend_Log_Writer_Mail extends Zend_Log_Writer_Abstract
// are assuming that the layout is for use with HTML.
$this->_layout->events =
implode('', $this->_layoutEventsToMail);
$this->_mail->setBodyHtml($this->_layout->render());
// If an exception occurs during rendering, convert it to a notice
// so we can avoid an exception thrown without a stack frame.
try {
$this->_mail->setBodyHtml($this->_layout->render());
} catch (Exception $e) {
trigger_error(
"exception occurred when rendering layout; " .
"unable to set html body for message; " .
"message = {$e->getMessage()}; " .
"code = {$e->getCode()}; " .
"exception class = " . get_class($e),
E_USER_NOTICE);
}
}
// Finally, send the mail, but re-throw any exceptions at the
// proper level of abstraction.
// Finally, send the mail. If an exception occurs, convert it into a
// warning-level message so we can avoid an exception thrown without a
// stack frame.
try {
$this->_mail->send();
} catch (Exception $e) {
throw new Zend_Log_Exception(
$e->getMessage(),
$e->getCode());
trigger_error(
"unable to send log entries via email; " .
"message = {$e->getMessage()}; " .
"code = {$e->getCode()}; " .
"exception class = " . get_class($e),
E_USER_WARNING);
}
}