M
M
McMike2016-12-09 11:06:39
Composer
McMike, 2016-12-09 11:06:39

Composer breaks, what should I do?

A big project, with a bunch of folders in vendor. None of the old people are gone.
Firstly, when deployed on a new machine, composer install does not complete successfully, but seems to go into some kind of cycle ...
Secondly, against this background, the question arose whether everything is used from there at all.
Any ideas how to find out?
Is it possible, according to the project structure, to create a composer.json?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Tokarev, 2016-12-09
@Vadiok

Is it possible, according to the project structure, to create a composer.json?

There are hardly any ready-made solutions.
You can write a script and go through the php files of the project, see where module imports, class calls are used, make a list, then filter it yourself so that only vendor dependencies remain in this list. The script must save data about "use" blocks as well as class calls containing "\" (regulars like /^(?:\s+)?new\s+(\\?[a-z\\]+).*$/iand /^(\s+)\s+(\\?[a-z\\]+)\:\:.*$/i).
Further, having information on vendors, you can already add them one by one to the new composer.json (package versions will need to be specified in accordance with the old composer), you will see on which file the script hangs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question