0

When I do

composer install mmerian/doctrine-timestamp

composer says

  [InvalidArgumentException]
  Could not find package mmerian/doctrine-timestamp at any version for your minimum-stability (stable). Check the pa
  ckage spelling or your minimum-stability

But with this

composer install mmerian/doctrine-timestamp=dev-master

it works out. How composer determines stability of a package? Can I make a version alpha by naming it alpha-master?

UPD My question differs slightly from the one suggested. It's not only about marking code as stable. Not sure how to phrase my question better, but see the answer I expected:

composer takes versions of a package from tags and branches. And most of the time it infers versions (unless specified explicitly, which is not recommended).

Versions taken from branches get stable stability. The ones taken from tags get stability based on their suffix.

As such, when running composer install mmerian/doctrine-timestamp with minimum-stability stable (which is the default), it can't find a stable version, since the only version as of yet is dev-master. And fails.

When running composer install mmerian/doctrine-timestamp=dev-master, the package implicitly gets (which I can't see in the docs) @dev stability flag, which basically means minimum-stability = dev for this particular package. Therefore it succeeds.

Community
  • 1
  • 1
x-yuri
  • 16,722
  • 15
  • 114
  • 161
  • It's whatever the package creator/maintainer says it is. It could be rock-solid and marked as `dev-master` or similar, or it could be flaky and dangerous and marked as stable. – elixenide Jan 14 '16 at 05:06
  • [Where exactly](https://github.com/mmerian/doctrine-timestamp/blob/master/composer.json) developer says it's `dev-master`? What are the rules governing assigning stability? – x-yuri Jan 14 '16 at 05:11
  • See the question linked above. In particular, see [this link from the top answer](https://getcomposer.org/doc/02-libraries.md#tags). – elixenide Jan 14 '16 at 05:21

0 Answers0