Closed nargotik closed 3 years ago
Resolution of #106 and #105
As on composer 2 installed.json comes with an new index [packages] instead of root
This code would not iterate between packages
foreach ($installed as $package) {
by adding this line before would make this composer 2 compatible and keep backward also:
$installed = is_array($installed['packages']) ? $installed['packages'] : $installed;
maybe this would be also a good aproach
$installed = empty($installed['packages']) ? $installed : $installed['packages'];
Looks like #107 was faster. Probably you both should merge your PRs?
Looks like #107 was faster. Probably you both should merge your PRs?
Yup only saw it after have done the pull request. From what i see @thojou looks more complete solution because he did the tests.
Personally thinking, the real solution is one line code don't need to do another call to check if is v2 if that new method only has one line of code, but that's a point of view.
Just hoping that one or another solution gets in production because phar-composer is not working in composer v2
@nargotik Thanks for looking into this! I've just fixed this via #114. :shipit:
Resolution of #106 and #105
As on composer 2 installed.json comes with an new index [packages] instead of root
This code would not iterate between packages
by adding this line before would make this composer 2 compatible and keep backward also: