Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

composer.lock timestamp format

I'm trying to track down the php setting that is causing diffs in my composer.lock file.

Some machines produces:

"time": "2017-01-06T14:33:56+00:00" 

On another machine:

"time": "2017-01-06 14:33:56" 

I commit the composer.lock file in git and these different time format is causing unnecessary diff.

like image 555
Yada Avatar asked Jan 09 '17 16:01

Yada


People also ask

What is difference between composer json and composer lock?

You see, while your composer. json file is a rough guide to the dependency versions that Composer should install, the composer. lock file is an exact record of the dependency versions that have been installed. That's right, it's recording what Composer has installed for you, right down to the commit hash.

Should I commit composer lock?

You should commit the composer.lock file to your project repo so that all people working on the project are locked to the same versions of dependencies (more below). This is the main role of the update command. It then implicitly runs the install command.

What is composer lock file?

composer. lock records the exact versions that are installed. So that you are in the same versions with your co-workers. composer install. Check for composer.lock file.


1 Answers

Composer changed the internally created timestamp format with version 1.3.0 - if you experience different results, make sure you update all your Composer installations to the most recent version (which is 1.3.1 at the time of writing) by running

composer selfupdate 

or maybe

sudo composer selfupdate 

depending on how Composer is installed.

like image 161
Sven Avatar answered Sep 18 '22 17:09

Sven