D
D
Dmitry Kolyada2018-07-20 10:19:31
Composer
Dmitry Kolyada, 2018-07-20 10:19:31

How to develop an opencart module that depends on third-party packages connected via composer?

Hello colleagues, please tell me the answer to this question. I plan to develop a module, but the problem is that the module will depend on third-party libraries, such as guzzle, propel, ... which, in my understanding, are connected via composer and lie in the vendor. In this regard, I have a question, how to assemble the module? do you really have to store the entire vendor in the module? Or is it bad form and is it customary to act differently?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-08-15
@prototype_denis

No, it's not a bad idea to keep vendors in your package, even if your package is included via composer.
It all depends on the problem that needs to be solved.
As an example, symfony/phpunit-bridge where this package, when launched, depending on the version of php and other parameters, installs a certain compatible version of phpunit in its directory and starts ... As well as a
bunch of other packages that store vendors.
I understand that a certain archive is loaded in the admin panel? If so, feel free to use composer archiveand distribute this package in this way.
The only thing to consider is whether to use the composer autoloader or your own wrapper, since not only your package can work with composer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question