@
@
@Twitt2021-08-07 15:35:02
Composer
@Twitt, 2021-08-07 15:35:02

Am I doing the correct steps to replace dependencies in prod?

I need to replace a dependency in the project, I locally deleted the previous library in composer.json and added a new one, did a composer update (so that it doesn’t pull from the .lock file), and in fact, these are all the actions that I have to do in production in this case? I heard that you can just delete the .lock file and do a new composer install. Is this behavior different from what happens with a composer update?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2021-08-07
@inoise

OK, but in real life things are a bit more complicated. The gender base is updated first, then you update the composer. Until it has been updated - there may be problems and errors associated with this. This is solved through blue-green deployment or containers, pre-collecting the entire artifact and only then directing users there

V
Vitsliputsli, 2021-08-08
@Vitsliputsli

Specify only the package you want to update in the composer update command.

I heard that you can just delete the .lock file and do a new composer install. Is this behavior different from what happens with a composer update?

No different, without finding a .lock file composer will run update instead of install.
and in fact, these are all the actions that I have to do in production in this case?

Yes, but don't do it under load, build first, then redirect the load to new code. Use blue/green, containers as Ivan Shumov wrote, or just symlinks on the same machine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question