[DCOM-108] [GH-184] Fix bug in classExists when using multiple autoloaders (i.e. ZF2) Created: 17/Sep/12  Updated: 20/Dec/13  Resolved: 14/Jan/13

Status: Closed
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of bramstroker:

Url: https://github.com/doctrine/common/pull/184

Message:

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.



 Comments   
Comment by Benjamin Eberlei [ 17/Sep/12 ]

A related Github Pull-Request [GH-184] was closed
https://github.com/doctrine/common/pull/184

Comment by Benjamin Eberlei [ 18/Sep/12 ]

A related Github Pull-Request [GH-184] was reopened
https://github.com/doctrine/common/pull/184

Comment by Marco Pivetta [ 14/Jan/13 ]

Handled in DCOM-136

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-184] was closed:
https://github.com/doctrine/dbal/pull/184

Generated at Tue Jul 29 09:01:55 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.