mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #238] [CLOSED] Add Configuration::setDefaultMetadataDriverImpl() method for convenience. #7903
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?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/238
Author: @sobstel
Created: 12/23/2011
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
7c10659Add Configuration::setDefaultMetadataDriverImpl() method for convenience.📊 Changes
1 file changed (+10 additions, -0 deletions)
View changed files
📝
lib/Doctrine/ORM/Configuration.php(+10 -0)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.