Autoloading within custom installers doesn't work as expected if "target-dir" is used #2079

df-jablan opened this Issue Jul 11, 2013 · 3 comments


None yet
3 participants

So here's the deal. I've got this package with this composer.json. As you can see, it requires "dreamfactory/lib-php-common-platform". This library has classes in the \DreamFactory\Platform\Utility namespace.

In a normal project, this is absolutely no problem thanks to Jordi's awesome Kung Fu. Multiple locations for a single namespace are completely supported via the "target-dir" option.

The problem here is that the above package also is targeted for the \DreamFactory\Platform\Utility namespace. But it seems the autoloader operates on the final output of composer, not the "work-in-progress" of what's been installed so far, as it were.

So, in a nutshell, autoloading a class from a "required" package, from within a custom installer fails -- even though the dependency has been installed.

I am not certain this is a bug or an undocumented feature. Jordi, any guidance?


Seldaek commented Jul 12, 2013

I think there is another issue related to custom installers and target-dir. Indeed the whole runtime-autoloading is borked and has many limitations so I'm not surprised. It's long overdue for an overhaul, but it's not such a trivial task.

Let me know if I can help in any way. :)


jrobeson commented Jul 13, 2014

@df-jablan : so does using psr-4 autoloading instead of target-dir solve this issue? or does it still manifest in some other form?

Seldaek closed this Apr 13, 2016

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