Search code examples
composer-phpzend-framework3

Where is the composer.json file located for a Zend Framework 3 application?


I'm looking at a Zend Framework 3 application on a server, and I don't see any composer.json file in the root.

I'm trying to download the entire application and add it to GitHub, but I don't want to download the vendor files (which I assume I can just download after running composer) but I'm not seeing any composer.json file to know what packages are external libraries, etc...

Does anybody know where the composer file is or what is the right way to go about this?

This is what's on the root directory

enter image description here


Solution

  • Long story short: it was deleted.

    Short story long: you should recreate the composer.json file from the vendor/composer/installed.json file. See this thread for more information.

    You shouldn't just download the original composer.json from the repo as @Alain Pomirol suggests, because there may be additional packages installed.

    Also, temporarily include the vendor directory in the git repository. When you're ready with the composer.json file install dependencies again and check via git diff if that person didn't make any forbidden modifications to the vendor files. I've seen that so many times before…