Heya,
> I'm stuck since a few days, I want to use my autoloader for some package.
>
> Is it possible to retrieve the definition of classpath in composer.json
> and use my autoloader or a custom class finder function ?
>
> "autoload": { "psr-0": {"Acme": "src/"} }
>
> There may be simpler ... what I want to do exactly :
>
> I have a classpath specific for each vendor and plugin (e.g:
> plugin/Acme), in my framework it is possible to replace a class by
> putting a class with the same name in the folder app/custom (e.g:
> app/custom/Acme/TheClass).
You can do "psr-0": {"Acme": ["app/custom/", "src/"]} - then it will
always check first in app/custom and fallback to src.
I would recommend using some sort of dependency injection instead of
relying on class name overrides though. It allows you to extend the
original class and overriding only the relevant parts instead of having
to copy paste it entirely. Makes such "hacks" more maintainable.
Cheers
--
Jordi Boggiano
@seldaek -
http://nelm.io/jordi