Skip to content

Fix bug in classExists when using multiple autoloaders (i.e. ZF2)#183

Closed
bramstroker wants to merge 1 commit into
doctrine:masterfrom
bramstroker:master
Closed

Fix bug in classExists when using multiple autoloaders (i.e. ZF2)#183
bramstroker wants to merge 1 commit into
doctrine:masterfrom
bramstroker:master

Conversation

@bramstroker

Copy link
Copy Markdown

The autoloading routine in the classExists method makes the assumption the autoload method always returns a value (i.e. no void) when the autoloading of a class is succesfull. When you have multiple autoloaders registered to the spl stack this can lead to problems. In my case I'm using ZF2 ClassmapAutoloader and StandardAutoloader as fallback. The classmapAutoloader returns nothing so the autoload method in the StandardAutoloader is called as well, because the for loop is continued. This results in a second include, and a fatal error "Cannot redeclare class" is triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants