1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Fix parser error if composer.json existing but empty

This commit is contained in:
vlakoff 2015-03-14 15:26:53 +01:00
parent d571874461
commit 3a68534d20

View file

@ -82,6 +82,10 @@ EOT
return 1;
}
if (file_get_contents($file) === '') {
file_put_contents($file, "{\n}\n");
}
$json = new JsonFile($file);
$composerDefinition = $json->read();
$composerBackup = file_get_contents($json->getPath());