How to define the semantics of packages downloaded with composer?

3

I created some PHP packages with composer help as a dependency manager and made it available in Packagist ( link ).

p>

After uploading the packages, I installed them inside a Laravel project. For this I used the following statement:

composer require crphp/check

When looking at Laravel's composer.json I saw the following line:

"crphp/check": "^1.0"

I can define within the package crphp/check so when it is installed it will assume another version semantics, such as 1.1.* ?

And this "default" semantics ^1.0 means what?

    
asked by anonymous 16.11.2016 / 23:18

1 answer

2

According to the Composer documentation :

  

Caret

     

The ^ operator behaves very similarly but it sticks closer to semantic   versioning, and will always allow non-breaking updates. For example   ^ 1.2.3 is equivalent to > = 1.2.3 < 2.0.0 as none of the until   2.0 should break backwards compatibility. For pre-1.0 versions it also acts with safety in mind and treats = 0.3.0

17.11.2016 / 13:14