How recover composer.json by existing project on symfony2?
You should create bare composer.json
by hand or using command composer init
.
And then you can list all the packages under the vendor
folder by composer show --installed
.
Then just generate require section for your composer.json
with listed values. And you are done. You can use regular expressions to do it easier.
composer show --installed \
| awk '{printf "\"%s\": \"^%s\",\n", $1, $2}' \
| sed -r 's:\^v:^:g' \
>> packages.list