What does the tilde (~) mean in my composer.json file?

后端 未结 3 2049
忘掉有多难
忘掉有多难 2020-12-23 00:16

I have this line in my composer.json file:

\"require\": {
    ...
    \"friendsofsymfony/user-bundle\": \"~2.0@dev\",
    ...
},

What does

3条回答
  •  清酒与你
    2020-12-23 00:54

    Tilde operator is useful for the projects that version their libraries using semantic versioning scheme.

    Semantic versioning is more of a guideline that evaluates to the next significant release.

    For Composer, this operator means to allow minor releases (that can include patches) without allowing a major version (that may not be backward compatible) while installing and updating.

    For example: ~4.1 will allow project versions >=4.1 but <5.0.

    Credits: http://dwellupper.io/post/37/using-tilde-range-operator-to-resolve-dependency-version-in-composer-php

提交回复
热议问题