[Swiftmailer] fixed the determination of the default port

This commit is contained in:
Fabien Potencier 2011-02-21 11:35:47 +01:00
parent 0dfd5960f1
commit 7a614cb1ea
2 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class Configuration
->scalarNode('username')->defaultNull()->end()
->scalarNode('password')->defaultNull()->end()
->scalarNode('host')->defaultValue('localhost')->end()
->scalarNode('port')->defaultValue(25)->end()
->scalarNode('port')->defaultValue(false)->end()
->scalarNode('encryption')
->defaultNull()
->validate()

View File

@ -71,8 +71,8 @@ class SwiftmailerExtension extends Extension
$container->setAlias('swiftmailer.transport', 'swiftmailer.transport.'.$transport);
if ('ssl' === $config['encryption'] && !isset($config['port'])) {
$config['port'] = 465;
if (false === $config['port']) {
$config['port'] = 'ssl' === $config['encryption'] ? 465 : 25;
}
foreach (array('encryption', 'port', 'host', 'username', 'password', 'auth_mode') as $key) {