Maintaining Consistent Environments5:28 with Alena Holligan
Having different versions of packages on different environments can cause issues with the application performing differently, and that can make tracking and fixing bugs next to impossible. Composer gives us another tool, a composer.lock file, that tells composer which version to use.
When updating to a patch version, nothing SHOULD break. But if you're trying to track down bugs, you want to make sure that it's not something introduced in someone else's code.
When updating composer dependencies, make sure you commit your composer.lock file to Version Control system. DO NOT commit your vendor folder.
composer install will look for a composer.lock file first and install the versions specified there. If a lock file does not exist, composer will use the composer.json file to install dependencies.
composer update will update all packages as well as the composer.lock file.
composer show will list all installed packages and their versions
You need to sign up for Treehouse in order to download course files.Sign up