Fix configuration to handle driver in dsn

This commit is contained in:
William DURAND 2012-07-16 19:45:46 +02:00
parent 4d36810657
commit 102c7acd60

View file

@ -118,7 +118,13 @@ class Configuration implements ConfigurationInterface
->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultValue('')->end()
->scalarNode('dsn')->defaultValue('')->end()
->scalarNode('dsn')
->beforeNormalization()
->always()
->then(function($v) { return str_replace('pdo_', '', $v); })
->end()
->defaultValue('')
->end()
->scalarNode('classname')->defaultValue($this->debug ? 'DebugPDO' : 'PropelPDO')->end()
->end()
->fixXmlConfig('option')
@ -186,7 +192,13 @@ class Configuration implements ConfigurationInterface
->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultValue('')->end()
->scalarNode('dsn')->defaultValue('')->end()
->scalarNode('dsn')
->beforeNormalization()
->always()
->then(function($v) { return str_replace('pdo_', '', $v); })
->end()
->defaultValue('')
->end()
->scalarNode('classname')->defaultValue($this->debug ? 'DebugPDO' : 'PropelPDO')->end()
->arrayNode('slaves')
->useAttributeAsKey('name')
@ -201,7 +213,13 @@ class Configuration implements ConfigurationInterface
->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultValue('')->end()
->scalarNode('dsn')->defaultValue('')->end()
->scalarNode('dsn')
->beforeNormalization()
->always()
->then(function($v) { return str_replace('pdo_', '', $v); })
->end()
->defaultValue('')
->end()
->scalarNode('classname')->defaultValue($this->debug ? 'DebugPDO' : 'PropelPDO')->end()
->end()
->end()