-
Notifications
You must be signed in to change notification settings - Fork 19
Autoloading breaks HTMLPurifier #51
Comments
Hoa's autoloader runs if Composer's one failed. Can you confirm that? |
@Hywan I think the fail here is that when Hoa fails to load a class, it forwards the autoloader call to composer but it does not forward it the same way it received it. Taking a look at the stack trace:
The last forward shows that the original class name has been modified from |
When I remove the first entry of my
Otherwise the error appears. Unfortunately I can't provide a minimal example in a quick way, but I'll investigate time in the next days. |
This PSR-0 vs. PSR-4. Hoa's autoloader is PSR-0 so it transforms |
No sorry, Hoa's autoloader is PSR-4 but for |
Also, @UFOMelkor, why Composer does not handle your class? |
@Hywan you can't blindly replace |
@jubianchi I replaced
This is why we have added the 436f30f commit. Also, Hoa's autoloader runs if and only if Composer has dropped. So, why Hoa's autoloader runs? Why Composer drops? |
@Hywan PSR-0 never said that autoloader should replace The only thinkg I see is the following:
Which is OK. |
@jubianchi |
@Hywan no it's not : when your replace character in class name, you create a bug : classes using I think that you should not do such assumption and just forward the autoloader call as you received it when you can't handle it. |
The issue is still open. Why Composer does not handle that class? |
I created a minimal example using symfony2. Perhaps anyone might have a look, I want have much time the next days. What I did: I created a simple bundle and I added the Exercise/HTMLPurifierBundle and PhpMetrics to composer and activated the first one. |
@Hywan autoloader files (which is how |
@jubianchi So a solution is to remove this piece of code and everything will be ok. We assume that Hoa's autoloader is PSR-4 and voilà? |
@UFOMelkor Could you test with #52 please? |
Looks good 👍 |
I use PhpMetrics within a project and PhpMetrics has a dependency on hoa/core.
Today I added the HTMLPurifier to the project (using composer) and the following error appears:
The Stacktrace:
As you can see the Autoloading is broken because it now looks for
HTMLPurifier\Bootstrap
instead ofHTMLPurifier_Bootstrap
.The text was updated successfully, but these errors were encountered: