composer/composer — Issue #139: Handle autoloading of app packages with a target-dir
Author: Seldaek
Created: 2011-11-30 21:10:01+00:00
State: open

If you take a symfony bundle for example, that does not have a proper PSR-0 directory structure, like https://github.com/snc/SncRedisBundle/blob/master/composer.json#L21 - it can not be autoloaded if you install it as a main package (not a dependency) since the autoloader will look for a "Snc" dir in the root of the package, but it doesn't exist.

One solution is to have a custom autoloader, only used for main packages that have a target-dir specified. It would just ignore the fact that the package should be in a subdir, and assume the current dir is the dir that is mapped on it. This could wrap or be chained with the standard autoloader easily.