Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZF2 2 modules with same name from different sources in vendor

I am working on a complex application that is divided in some sub-applications with their own logic. Those sub-applications are included in composer.json file of the main application and the module paths of sub-application are included in the main application.

For example main app module_paths contains:

./vendor,
./vendor/app1/module
./vendor/app2/module

The problem is that both app1 and app2 have a module with the same name and both of them need to be loaded in the main application.

Is there a way to load 2 modules with the same name but from different sources?

like image 421
Radu Pavelco Avatar asked Nov 27 '25 21:11

Radu Pavelco


1 Answers

As @Crisp suggests the problem could best be solved with a vendor prefix in the module name.

Instead of persuading the vendor and waiting for their next release you can easily make a fork of the repository on GitHub and use your fork with the prefix in your application.

On how to include your custom fork into composer.json you can read here.

If you do this you can even make a pull-request which might encourage the vendors to merge your pre-fix solution into their branch.

like image 153
Wilt Avatar answered Nov 29 '25 12:11

Wilt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!