Resolved Composer Namespace Issues

I actually resolved the namespace conflicts that came with composer. As described in the other post I prefixed these 3rd party libraries and commit them to my repository (I placed them in lib/vendor/<vendor>/<package> ).

I also use an PSR-4 autoloaderfrom fig-standards ) to load these libs (make sure you prefix the class name at least or put it in your namespace):

And use it like this:

Since I want to keep using composer for require-dev dependencies I load composers autoloader too if it exists (It exists in the plugin development environment of course).

I think the issue is resolved this way. After all it wasn’t this hard – that’s why I’m planning to use composer as usual and automate the prefixing and move with grunt in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *