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.

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Spelling error report

The following text will be sent to our editors: