mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-318: AnnotationDriver::getAllClassNames() can incorrectly return empty array #391
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 (Feb 11, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user bjori:
Calling AnnotationDriver::getAllClassNames() 2 times will result in a wrongly empty array() for the second call.
The only case I can think of where this method actually gets called 2 times is when you are calling multiple doctrine cli tasks from the same PHP process (like, for example, generating the schema and then the proxy files in a deployment script).
Attached is a patch to use a local static variable to skip the get_declared_classes() on subsequent calls.
The quickest example I can think of to demonstrate the issue is to modify the sandbox to call the generate-proxies method 2 times.
The first run will generate the proxy classes, the second run will say "No classes".