When php develops a project, composer is used to manage dependencies. composer.json and composer.lock record the version numbers and other information that the project depends on. When composer.json and composer.lock are accidentally damaged or lost, how to determine the version number of the project's dependencies? In this case, when running composer require XXX to install new dependencies, how to ensure that the dependent libraries of the system principle are not updated or changed?
Or to ask another way, when the system dependent libraries already exist, how to reversely generate their corresponding composer.json based on these system dependent libraries? Is there any automated way?
Don’t you use version management? If it doesn’t work, go check out the vendor’s source code. There are versions of dependencies in it, and the PHP files generated by composer have detailed contents
The project source code is lost, how can I restore it out of thin air?