-
Notifications
You must be signed in to change notification settings - Fork 232
Add support for detecting bundle mapping with the new bundle structure #713
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
Conversation
@mbabker thanks for the PR!
Could you please link what the newer directory structure looks like? I tried googling but to no avail, from the PR I guess that If above is true we have some references in the docs that mapping files should be put in |
Pretty much the same as a Flex application's structure, see https://symfony.com/doc/current/bundles/best_practices.html#directory-structure
It's not entirely Symfony version dependent, it's pretty much 100% bundle dependent. Symfony itself supports the newer root structure since 4.4, but admittedly I haven't seen it used on too many bundles yet (I'm using it on branches I've dropped Symfony 3.4 support because I do think it's a bit cleaner, but that's a subjective opinion at best), and I can't say I've seen anything that implies that the older structure with the The gist of it though is that for bundles, if you use the structure recommended in the best practices guide, when a combination of the Doctrine Bridge PR and the Doctrine bundle PR(s) (both here and the ORM) relevant to your bundle land, and your minimum versions support these PRs, then you can put your mapping files in |
Thanks for the explanation :) I still think the docs could be updated to reflect that |
$loader->load($config, $container); | ||
|
||
$calls = $container->getDefinition('doctrine_mongodb.odm.default_metadata_driver')->getMethodCalls(); | ||
$this->assertEquals('doctrine_mongodb.odm.default_xml_metadata_driver', (string) $calls[0][1][0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this assert is failing because this will only be true when using Symfony >= 5.4 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'll have to figure out what's happening differently here compared to DoctrineBundle then because the CI build is green with the same feature PR merged and I didn't add any conditionals to the tests there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm comparing with https://github.com/doctrine/DoctrineBundle/pull/1418/files, there is no testNewBundleStructureXmlBundleMappingDetection
test there
|
Restarting the build |
Thanks a lot @mbabker! |
Companion PR to symfony/symfony#43181
This adds support for detecting bundle mapping if a bundle is using the newer directory structure.