How to restore .json composer from an existing symfony2 project?

I need to work on a project on symphony 2 without composer configuration, but with the / * folder providers in the repository.

I want to reinstall the composer and create a configuration for an existing package. Is it possible?

Thanks!

+6
source share
2 answers

You must create bare composer.json manually or using the composer init command.

And then you can list all the packages in the vendor folder on composer show --installed .

Then just generate the required section for composer.json with the specified values. And you're done. You can use regular expressions to make this easier.

+4
source
  composer update Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 1 update, 8 removals - Removing yiisoft/yii2-jui (2.0.7) - Removing bower-asset/jquery-ui (1.12.1) - Removing phpoffice/phpspreadsheet (1.0.0) - Removing psr/simple-cache (1.0.0) - Removing guzzlehttp/guzzle (5.0.0) - Removing guzzlehttp/ringphp (1.1.0) - Removing guzzlehttp/streams (3.0.0) - Removing react/promise (v2.5.1) - Updating swiftmailer/swiftmailer (v5.4.8 => v5.4.9): Downloading (100%) Writing lock file Generating autoload files 

I think you can do composer update , it will show you all the packages and then composer install ... one by one

0
source

Source: https://habr.com/ru/post/983224/


All Articles