umpirsky
umpirsky

Reputation: 10024

Resolving Dependency Hell with Composer

This is the scenario.

You have package A and package B in your composer.json (your app depends on this 2 packages).

Both package A and B depend on package C, but on different versions. Say A depend on C v2.1, and B depends on C v2.2.

And you get version conflicts.

Both A, B and C are third party packages.

How to resolve this?

Upvotes: 11

Views: 3286

Answers (2)

Joseph
Joseph

Reputation: 1091

We are discussing it in this mailing list : http://news.php.net/php.internals/72594

"No-conflict" technique must be implemented in PHP , it's not a composer fault

Upvotes: 0

Jakub Zalas
Jakub Zalas

Reputation: 36191

This is a hack but will probably let you move forward.

You could overwrite repositories for "A", "B" and "C" packages and make that "A" and "B" rely on the same version of "C" (actually, might be that it's enough to overwrite repositories for "A" and "B" only).

This should work as long as both "A" and "B" can work with the latest version of "C" (so probably a maintainer didn't update the package version). If it's the case I'd also consider sending a pull request to the project which has an older version of a dependency.

Upvotes: 3

Related Questions