File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -58,21 +58,27 @@ public function build(ContainerBuilder $container)
58
58
}
59
59
60
60
/**
61
- * Searches a mapping compiler: try cmf CoreBundle first and fallback on DoctrineBundle.
61
+ * Searches a mapping compiler (doctrine bridge compiler is missing in symfony < 2.3).
62
+ * Use Cmf\CoreBundle in that case.
62
63
*/
63
64
private function findDoctrineOrmCompiler ()
64
65
{
65
- if (class_exists ('Symfony\Cmf\Bundle\CoreBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' )) {
66
- return 'Symfony\Cmf\Bundle\CoreBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' ;
67
- }
66
+ $ symfonyVersion = class_exists ('Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterMappingsPass ' );
68
67
69
- if (class_exists ('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' )) {
68
+ if (symfonyVersion && class_exists ('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' )) {
70
69
return 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' ;
71
70
}
72
71
72
+ if (class_exists ('Symfony\Cmf\Bundle\CoreBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' )) {
73
+ return 'Symfony\Cmf\Bundle\CoreBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' ;
74
+ }
75
+
73
76
return false ;
74
77
}
75
78
79
+ /**
80
+ * Instantiate compiler now because of SymfonyFileLocator namespace issue (see phpcr method comment).
81
+ */
76
82
private function buildBaseOrmCompilerPass ($ doctrineOrmCompiler )
77
83
{
78
84
$ arguments = array (array (realpath (__DIR__ . '/Resources/config/doctrine-base ' )), '.orm.xml ' );
You can’t perform that action at this time.
0 commit comments