Reputation: 7114
Let's say that multiple people are working on the same project where vendor files are maintained with composer. Person A runs:
composer update
command to update dependencies to its latest versions and stores the changes into the composer.lock
file.
A now pushes composer.lock
file and person B pulls it from the repository.
Now B has the updated composer.lock
file, but outdated vendor files.
What should B do to update vendor files to version stored in the new composer.lock
file?
Will composer install
check for versions of vendor files and compare them with versions stored inside composer.lock
and update outdated files?
Or is it necessary to manually delete all vendor files before running composer install
?
Upvotes: 1
Views: 1466
Reputation: 47329
Running composer install
on an application with an existing vendor
directory will cause packages to be updated (packages installed, updated and removed) so the vendor
directory matches what's declared on the lock file.
Personally, if I'm running install
I'll delete vendor
contents anyway.
But that's just to make sure I'm not missing anything, and no unexpected artefact as the autoloader files or anything like that is left behind.
Upvotes: 1