Why I Impersonated a Fedex Delivery Driver and What I Learned about Decision Making

When I arrived an hour or so-ish early to the office, I felt awkward and flustered like it was my first day of work. I was jet-lagged from having landed in Tokyo a week earlier, and had sliced a nice…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Composer Install vs Composer Update

When should we use the composer install or the composer update?

I have done some basic research and found out the following:

The major talking point is actually about composer.lock and composer.json.

The assumption is that you just crafted a fresh PHP project, created a composer.json file and required some packages. For this article, we can assume this:

On the composer install command, because there is no composer.lock file yet, composer uses the composer.json file and installs the monolog package(creates a vendor folder with the package installed). Simple right?composer update actually does the same thing in this scenario.

The assumption is that there is already a project on ground and composer install or update has been run one or more times.

Running the composer install uses the composer.lock file, which now has the “lock” on all packages you have installed on the project. The advantage of this is that, 3months down the line, if this project is picked up by anyone and composer install is run, you can be sure that no dependency will break., because the versions have been locked to what you have in the composer.lock file.

Another advantage is that say you are in a team of 6, with composer install we can be sure that every one has the same version/release of each package at any given period of time until composer update is run.

In the case of composer update, it does not use the lock file, instead it uses the composer.json file and updates the packages(if updates have been released in the last 3 months). Which gives us one problem, what if a package has broken code in its latest release?

There are definitely use cases for both, and we should know what to apply to our different cases.

References

Add a comment

Related posts:

Radiohead Bear

This t-shirt is Made To Order, one by one printed so we can control the quality. We use newest DTG Technology to print on to T-Shirt. Color variant is black, gray, white , and Many More. Pre-Shrunk…

The average yearly Medicare Hospital Insurance benefit?

The average yearly Medicare Hospital Insurance benefit per person was $4325 recently. If benefits are normally distributed with a standard deviation of $500, find the probability that the mean…

How THE CHANGE Changed Me

When I first started my career as a teacher as a whippersnapper at the age of twenty-three, I saw an older colleague in our lounge, fanning herself and sweating. I thought she was having a heart…