From 1e5aaefaf5a12f1f728cb00bc83f15ebd60a714d Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Mon, 12 Sep 2011 16:59:05 +0200 Subject: [PATCH] Force empty lock files to contain a JSON object By default it will make it an array, since PHP does not distinguish between arrays and hash(map)s. --- src/Composer/Command/InstallCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php index 6e12ca1dd..add683faf 100644 --- a/src/Composer/Command/InstallCommand.php +++ b/src/Composer/Command/InstallCommand.php @@ -154,7 +154,7 @@ class InstallCommand protected function storeLockFile(array $content) { - file_put_contents('composer.lock', json_encode($content)."\n"); + file_put_contents('composer.lock', json_encode($content, JSON_FORCE_OBJECT)."\n"); echo '> composer.lock dumped'.PHP_EOL; } } \ No newline at end of file