mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3551: [GH-1294] Avoid Connection error when calling ClassMetadataFactor::getAllMetadata() #4370
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 (Jan 29, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of weaverryan:
Url: https://github.com/doctrine/doctrine2/pull/1294
Message:
Hi guys!
When you pair the ORM with DBAL 2.5.0, then getting the
targetPlatformmeans that a connection will be made to the database. For that reason, it's really important to not get thetargetPlatformunless it's absolutely needed. Currently, if you callClassMetadataFactor::getAllMetadata(), it will try to determinetargetPlatform(ininitialize()), which will make a connection. And if that connection fails (e.g. no db yet), it will blow up - even thoughgetAllMetadata()doesn't need thetargetPlatform.This fixes that, and in an absolutely BC way, since
targetPlatformis private (yay!). This should fix a number of issues in userland, like symfony/symfony-standard#748 and symfony/symfony-standard#774.This is a PR to master (per the guidelines), but the real target is 2.4, since it's the latest stable. The patch won't apply cleanly, but it's simple: remove from initialize, then replace all references to the new private method.
Thanks in advance! More details are on the commit message.
@doctrinebot commented on GitHub (Feb 4, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1294] was merged:
https://github.com/doctrine/doctrine2/pull/1294
@doctrinebot commented on GitHub (Feb 4, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1294] was assigned:
https://github.com/doctrine/doctrine2/pull/1294
@doctrinebot commented on GitHub (Feb 4, 2015):
Issue was closed with resolution "Fixed"