diff -r 5a6b6e770365 -r 68c69c656a2c web/lib/Zend/Application/Resource/Mail.php --- a/web/lib/Zend/Application/Resource/Mail.php Thu May 07 15:10:09 2015 +0200 +++ b/web/lib/Zend/Application/Resource/Mail.php Thu May 07 15:16:02 2015 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Mail.php 24593 2012-01-05 20:35:02Z matthew $ + * @version $Id$ */ /** @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceAbstract @@ -43,7 +43,8 @@ */ protected $_transport; - public function init() { + public function init() + { return $this->getMail(); } @@ -55,21 +56,21 @@ { if (null === $this->_transport) { $options = $this->getOptions(); - foreach($options as $key => $option) { + foreach ($options as $key => $option) { $options[strtolower($key)] = $option; } $this->setOptions($options); - if(isset($options['transport']) && - !is_numeric($options['transport'])) - { + if (isset($options['transport']) + && !is_numeric($options['transport']) + ) { $this->_transport = $this->_setupTransport($options['transport']); - if(!isset($options['transport']['register']) || - $options['transport']['register'] == '1' || - (isset($options['transport']['register']) && - !is_numeric($options['transport']['register']) && - (bool) $options['transport']['register'] == true)) - { + if (!isset($options['transport']['register']) + || $options['transport']['register'] == '1' + || (isset($options['transport']['register']) + && !is_numeric($options['transport']['register']) + && (bool)$options['transport']['register'] == true) + ) { Zend_Mail::setDefaultTransport($this->_transport); } } @@ -81,19 +82,23 @@ return $this->_transport; } - protected function _setDefaults($type) { + protected function _setDefaults($type) + { $key = strtolower('default' . $type); $options = $this->getOptions(); - if(isset($options[$key]['email']) && - !is_numeric($options[$key]['email'])) - { + if (isset($options[$key]['email']) + && !is_numeric($options[$key]['email']) + ) { $method = array('Zend_Mail', 'setDefault' . ucfirst($type)); - if(isset($options[$key]['name']) && - !is_numeric($options[$key]['name'])) - { - call_user_func($method, $options[$key]['email'], - $options[$key]['name']); + if (isset($options[$key]['name']) + && !is_numeric( + $options[$key]['name'] + ) + ) { + call_user_func( + $method, $options[$key]['email'], $options[$key]['name'] + ); } else { call_user_func($method, $options[$key]['email']); } @@ -102,19 +107,17 @@ protected function _setupTransport($options) { - if(!isset($options['type'])) { + if (!isset($options['type'])) { $options['type'] = 'sendmail'; } - + $transportName = $options['type']; - if(!Zend_Loader_Autoloader::autoload($transportName)) - { + if (!Zend_Loader_Autoloader::autoload($transportName)) { $transportName = ucfirst(strtolower($transportName)); - if(!Zend_Loader_Autoloader::autoload($transportName)) - { + if (!Zend_Loader_Autoloader::autoload($transportName)) { $transportName = 'Zend_Mail_Transport_' . $transportName; - if(!Zend_Loader_Autoloader::autoload($transportName)) { + if (!Zend_Loader_Autoloader::autoload($transportName)) { throw new Zend_Application_Resource_Exception( "Specified Mail Transport '{$transportName}'" . 'could not be found' @@ -128,10 +131,11 @@ switch($transportName) { case 'Zend_Mail_Transport_Smtp': - if(!isset($options['host'])) { + if (!isset($options['host'])) { throw new Zend_Application_Resource_Exception( 'A host is necessary for smtp transport,' - .' but none was given'); + . ' but none was given' + ); } $transport = new $transportName($options['host'], $options);