@@ -25,7 +25,7 @@ public function load(array $configs, ContainerBuilder $container)
25
25
$ config = $ this ->processConfiguration (new Configuration (), $ configs );
26
26
$ loader = new XmlFileLoader ($ container , new FileLocator (__DIR__ .'/../Resources/config ' ));
27
27
28
- if (! empty ( $ config ['dynamic ' ]['enabled ' ]) ) {
28
+ if ($ config ['dynamic ' ]['enabled ' ]) {
29
29
// load this even if no explicit enabled value but some configuration
30
30
$ this ->setupDynamicRouter ($ config ['dynamic ' ], $ container , $ loader );
31
31
}
@@ -88,13 +88,17 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
88
88
89
89
$ hasProvider = false ;
90
90
$ hasContentRepository = false ;
91
- if (!empty ($ config ['persistence ' ]['phpcr ' ]['enabled ' ])) {
91
+ if ($ config ['persistence ' ]['phpcr ' ]['enabled ' ] && $ config ['persistence ' ]['orm ' ]['enabled ' ]) {
92
+ throw new InvalidConfigurationException ('You can only enable either phpcr or orm, not both. ' );
93
+ }
94
+
95
+ if ($ config ['persistence ' ]['phpcr ' ]['enabled ' ]) {
92
96
$ this ->loadPhpcrProvider ($ config ['persistence ' ]['phpcr ' ], $ loader , $ container , $ locales );
93
97
$ hasProvider = true ;
94
98
$ hasContentRepository = true ;
95
99
}
96
100
97
- if (! empty ( $ config ['persistence ' ]['orm ' ]['enabled ' ]) ) {
101
+ if ($ config ['persistence ' ]['orm ' ]['enabled ' ]) {
98
102
$ this ->loadOrmProvider ($ config ['persistence ' ]['orm ' ], $ loader , $ container );
99
103
$ hasProvider = true ;
100
104
}
0 commit comments