Composer Basic Usage

composer.json This file contains the project’s dependencies and some other metadata { "require": { "monolog/monolog": "1.0.*" } } Version Explanation: ~ indicates that only the last segment of the version number can change (if it’s ~x.y then the last segment is y, if it’s ~x.y.z then the last segment is z) ~1.2.3 means 1.2.3 <= version number < 1.3.0 ~1.2 means 1.2 <= version number < 2.0 ^ indicates that all segments except the major version number can change ^1.2.3 means 1.2.3 <= version number < 2.0.0 Special case for versions starting with 0: ^0.3.0 equals 0.3.0 <= version number < 0.4.0 Note: Not < 1.0.0 Because: according to semantic versioning rules, a major version number starting with 0 indicates that it is an unstable version, and minor version numbers are allowed to be incompatible in an unstable state. So,...

December 19, 2019 · 2 min · 587 words · ZhangYong