Skip to content
Browse files

Added before normalization treatment on 'driver' nodes

  • Loading branch information...
1 parent c02e7ce commit 6a648ed7e983d1601c7f84985f1da7b7ae9fa426 @willdurand willdurand committed May 8, 2012
Showing with 21 additions and 3 deletions.
  1. +21 −3 DependencyInjection/Configuration.php
View
24 DependencyInjection/Configuration.php
@@ -102,7 +102,13 @@ private function addDbalSection(ArrayNodeDefinition $node)
->end()
->children()
->scalarNode('default_connection')->defaultValue('default')->end()
- ->scalarNode('driver')->defaultValue('mysql')->end()
+ ->scalarNode('driver')
+ ->beforeNormalization()
+ ->always()
+ ->then(function($v) { return str_replace('pdo_', '', $v); })
+ ->end()
+ ->defaultValue('mysql')
+ ->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultValue('')->end()
->scalarNode('dsn')->defaultValue('')->end()
@@ -164,7 +170,13 @@ private function getDbalConnectionsNode()
->useAttributeAsKey('name')
->prototype('array')
->children()
- ->scalarNode('driver')->defaultValue('mysql')->end()
+ ->scalarNode('driver')
+ ->beforeNormalization()
+ ->always()
+ ->then(function($v) { return str_replace('pdo_', '', $v); })
+ ->end()
+ ->defaultValue('mysql')
+ ->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultValue('')->end()
->scalarNode('dsn')->defaultValue('')->end()
@@ -173,7 +185,13 @@ private function getDbalConnectionsNode()
->useAttributeAsKey('name')
->prototype('array')
->children()
- ->scalarNode('driver')->defaultValue('mysql')->end()
+ ->scalarNode('driver')
+ ->beforeNormalization()
+ ->always()
+ ->then(function($v) { return str_replace('pdo_', '', $v); })
+ ->end()
+ ->defaultValue('mysql')
+ ->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultValue('')->end()
->scalarNode('dsn')->defaultValue('')->end()

0 comments on commit 6a648ed

Please sign in to comment.
Something went wrong with that request. Please try again.