1
0
Fork 0

Add forward compatibility for upcoming v2 installed.json format, refs #7999

pull/8017/head
Jordi Boggiano 2019-02-21 12:57:27 +01:00
parent 61cd8664e5
commit ba346ef04d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,11 @@ class FilesystemRepository extends WritableArrayRepository
try {
$packages = $this->file->read();
// forward compatibility for composer v2 installed.json
if (isset($packages['packages'])) {
$packages = $packages['packages'];
}
if (!is_array($packages)) {
throw new \UnexpectedValueException('Could not parse package list from the repository');
}