Skip to content

Instantly share code, notes, and snippets.

@lasekmiroslaw
Last active August 25, 2018 17:46
Show Gist options
  • Save lasekmiroslaw/6a5579ff10fb05b02e95068eef35b076 to your computer and use it in GitHub Desktop.
Save lasekmiroslaw/6a5579ff10fb05b02e95068eef35b076 to your computer and use it in GitHub Desktop.
composer versions and Constraints, update #composer
https://getcomposer.org/doc/articles/versions.md#writing-version-constraints
1.0 - 2.0 is equivalent to >=1.0.0 <2.1
~1.2 is equivalent to >=1.2 <2.0.0, while ~1.2.3 is equivalent to >=1.2.3 <1.3.0
^1.2.3 is equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards compatibility.
pre-1.0 versions it also acts with safety in mind and treats ^0.3 as >=0.3.0 <0.4.0
1.2.3 =1.2.3.0-stable
>1.2 >1.2.0.0-stable
>=1.2 >=1.2.0.0-dev
>=1.2-stable >=1.2.0.0-stable
<1.3 <1.3.0.0-dev
<=1.3 <=1.3.0.0-stable
1 - 2 >=1.0.0.0-dev <3.0.0.0-dev
~1.3 >=1.3.0.0-dev <2.0.0.0-dev
1.4.* >=1.4.0.0-dev <1.5.0.0-dev
lists all updates.
composer update --dry-run
composer update --dry-run --with-dependencies
then
composer update package/name
https://www.youtube.com/watch?v=jUsEqy1YRzA 32:00
composer lock cannot be updated witouth conflicts. to overcome:
git checkout <branch> --composer.lock // branch - base branch to you are merging (e.g. master)
-repeat composer update <list of deps>
store parameters in commit message
seperate commit for lock file update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment