diff --git a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Configuration.php
index 5fa370a032..9c8a91dd31 100644
--- a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Configuration.php
@@ -139,6 +139,22 @@ class Configuration implements ConfigurationInterface
$node
->children()
->arrayNode('orm')
+ ->beforeNormalization()
+ ->ifTrue(function ($v) { return is_array($v) && !array_key_exists('entity_managers', $v) && !array_key_exists('entity_manager', $v); })
+ ->then(function ($v) {
+ $entityManager = array();
+ foreach (array('result_cache_driver', 'result-cache-driver', 'metadata_cache_driver', 'metadata-cache-driver', 'query_cache_driver', 'query-cache-driver', 'mappings', 'mapping', 'connection') as $key) {
+ if (array_key_exists($key, $v)) {
+ $entityManager[$key] = $v[$key];
+ unset($v[$key]);
+ }
+ }
+ $v['default_entity_manager'] = isset($v['default_entity_manager']) ? (string) $v['default_entity_manager'] : 'default';
+ $v['entity_managers'] = array($v['default_entity_manager'] => $entityManager);
+
+ return $v;
+ })
+ ->end()
->children()
->scalarNode('default_entity_manager')->end()
->booleanNode('auto_generate_proxy_classes')->defaultFalse()->end()
diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml
index bd40950b34..232fd964f2 100644
--- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml
+++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml
@@ -11,15 +11,13 @@
-
-
-
-
-
-
+
+
+
+
diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml
index ec2d3659c4..84b18152ba 100644
--- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml
+++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml
@@ -6,16 +6,13 @@ doctrine:
dbname: db
orm:
- default_entity_manager: default
- entity_managers:
- default:
- mappings:
- AnnotationsBundle: ~
- YamlBundle:
- dir: Resources/config/doctrine/metadata
- alias: yml
- manual:
- type: xml
- prefix: Fixtures\Bundles\XmlBundle
- dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/metadata
- alias: TestAlias
+ mappings:
+ AnnotationsBundle: ~
+ YamlBundle:
+ dir: Resources/config/doctrine/metadata
+ alias: yml
+ manual:
+ type: xml
+ prefix: Fixtures\Bundles\XmlBundle
+ dir: %kernel.root_dir%/../src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/metadata
+ alias: TestAlias