mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1559: GH-238: Add Configuration::setDefaultMetadataDriverImpl() method for convenience. #1954
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Dec 23, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user @beberlei:
Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/238
Current logic to setup Doctrine2 is a bit cluttered, because there's a circular dependency between $config and $driverImpl, which makes it impossible to configure things in Dependency Injection container.
Configuration is not fully initialized (and not added to service map) when setMetadataDriverImpl is called, but then setMetadataDriverImpl needs to call Configuration's newDefaultAnnotationDriver. Dependency deadlock.
I think that simpliest way to solve is to introduce setDefaultMetadataDriverImpl() method like this:
If you use non-default driver, you need to define everything explicitly anyway.
For default one, now you need to read annotations class and copy logic from newDefaultAnnotationDriver to DI container map on your own.
@doctrinebot commented on GitHub (Dec 28, 2011):
Issue was closed with resolution "Invalid"