Detecting modified files in the vendor directory with composer
Published on 2022-08-01 • Modified on 2022-08-01
This snippet shows how to list modified files in the vendor directory with composer. We all did it! Modifying files in the vendor directory to debug stuff. But, It can also happen that you close the file without removing the debug... You can't use
git status because it only works on your project files Composer has a command for this purpose for the vendor files. Note that you can have false positives like
composer/package-versions-deprecated I have on this project. But, the
vendor/symfony/framework-bundle/Controller/AbstractController.php file I have modified is correctly reported.
composer status -v # You have changes in the following dependencies: # /Users/coil/Sites/strangebuzz.com/vendor/composer/package-versions-deprecated: # ./src/PackageVersions/Versions.php # /Users/coil/Sites/strangebuzz.com/vendor/phpstan/extension-installer: # ./src/GeneratedConfig.php # /Users/coil/Sites/strangebuzz.com/vendor/symfony/framework-bundle: # ./Controller/AbstractController.php