I have to work on a project on symphony 2 without composer's config, but with folders vendor/* in the repository.
I want to re-install the composer and generate a configuration for an existing package. Is it possible?
Thanks!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With