![]() If your code is tested with your current package versions then running update may cause breakages which may require further work and testing, so don't run update unless you have a specific reason to and understand exactly what it means. ![]() To clarify further – you should probably only ever run composer update locally, never on your server as it is reasonably likely to break apps in production. I often see complaints that people can't use composer because they can't run it on their server (e.g. because it's shared and they have no shell access). In that case, you can still use composer: run it locally (an environment that has no such restrictions), and upload the local vendor folder it generates along with all your other PHP scripts. Running composer update also performs a composer install, and if you do not currently have a vendor folder (normal if you have a fresh checkout of a project), then it will create one, and also overwrite any composer.lock file you already have, updating package versions tagged in it, and this is what is potentially dangerous. Similarly, if you do not currently have a composer.lock file (e.g. ![]() if it was not committed to the project), then composer install also effectively performs a composer update. It is also possible to update a single package by naming it, for example: composer update ramsey/uuid It's thus vital to understand the difference between the two as they are definitely not interchangeable. This will re-resolve the version specified in your composer.json and install it in your vendor folder, and update your composer.lock file to match.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |