Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility with Composer v2 installed.json files #533

Merged
merged 1 commit into from
Jan 20, 2020

Conversation

naderman
Copy link
Contributor

The installed.json is now a map with one entry for packages containing the same former array of packages.

The installed.json is now a map with one entry for packages containing the
same former array of packages.
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! 👍

throw FailedToParseJson::inFile($installedJsonPath);
}

/** @var list<array{name: string, autoload: array{classmap: array<int, string>, files: array<int, string>, psr-4: array<string, array<int, string>>, psr-0: array<string, array<int, string>>}}>|null $installed*/
$installed = $installedJson['packages'] ?? $installedJson;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this correctly, 2.0 will have the packages moved one level down? Can't this BC break be prevented overall, if the structure was preserved, and a separate metadata file was added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's all that happened. The file is now a map of values, so we can add elements to it in the future without BC breaks. I think the goal was not to add even more metadata files, and rather accept that 2.0 is a BC break anyway and reformat this in a way allowing for future modification without BC breaks. cc @Seldaek

@Ocramius Ocramius self-assigned this Jan 20, 2020
@Ocramius Ocramius added this to the 4.0.0 milestone Jan 20, 2020
@Ocramius Ocramius merged commit 31d4062 into Roave:master Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants