A
A
Alexander Valinurov2015-06-25 17:28:45
Yii
Alexander Valinurov, 2015-06-25 17:28:45

How to separately install a package of a different version in composer?

Hey!
The project uses Yii2, which uses codeception, which in turn uses guzzle.
I need to write functionality in a project using guzzle 6.0 where asynchronous requests were introduced.
But composer doesn't allow guzzle to be updated, because the dependencies for codeception are hard-coded
"guzzlehttp/guzzle": "~4.0|~5.0",
. Is it possible to somehow install guzzle separately via composer?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Khomenko, 2015-06-25
@CentOS

I didn't do that, it's just a thought.
1. Codeception needs Yii2 for testing. That's why it's placed in the "require-dev" section of composer.json. That is, if you do not use testing, you can not pull Codeception through Composer. You just need to update the packages with the --no-dev key and those packages that are registered in "require-dev" will be removed from the vendor folder. In "require" you can register the Guzzle you need and install it.
2. Theoretically(!) you can connect several Composers to the project, in different folders. You just need to include the autoload.php from the "vendor" folder with the application. But something tells me that there will be a conflict in namespaces if you try to connect two different versions of Guzzle to the project.
Result:
composer.json
Try it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question