-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Allow AbstractDoctrineExtension implementations to support the newer bundle structure #43181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow AbstractDoctrineExtension implementations to support the newer bundle structure #43181
Conversation
src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
Outdated
Show resolved
Hide resolved
4f7956f
to
dcd69c2
Compare
1abd3c7
to
2dac6d0
Compare
2dac6d0
to
5fb8713
Compare
c321b30
to
fe42094
Compare
@mbabker I force-pushed these changes on your fork, can you please have a look and let me know if that makes sense? Is that something that can be tested? |
Looks right to me.
Maybe? I'd have to sit down and work out testing the Edit: I got PhpStorm to run the bridge tests with coverage to see if there was something existing I could add to, |
I guess this is tested in DoctrineBundle? |
It would have to be since |
Can you please send a PR to DoctrineBundle to add the new arguments there? |
Sure thing! |
DoctrineBundle PR is doctrine/DoctrineBundle#1418 |
fe42094
to
6d04a16
Compare
…upport the newer bundle structure
6d04a16
to
136c4a3
Compare
Not sure what "newer bundle directory structure" refers to. |
To answer my own question: #32845 |
See also symfony/symfony-docs#16109, doc has some inconsistencies that should be fixed. |
Thank you @mbabker. |
Container extensions inheriting from
Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension
(i.e. the extensions in all Doctrine bundles) currently cannot smoothly support the newer bundle directory structure because the existing API relies on information being gleaned from Reflection for the bundle class. This PR is an attempt to allow these extensions to support the newer structure. The notable changes here are:getMappingDriverBundleConfigDefaults()
method adds astring $bundleDir
argument which replaces gleaning the bundle directory by reflecting on the Bundle classgetMappingResourceConfigDirectory()
method adds astring $bundleDir
argument, this is needed for the concrete implementations to have conditional paths supporting both structures (similar to other checks in the framework like theis_dir($bundleDir.'/Resources/views') ? $bundleDir.'/Resources/views' : $bundleDir.'/templates'
check for the templates path)