giorgiosironi
giorgiosironi

Reputation: 1104

`composer install` running on `hhvm` even if I require `php`

I have put

"require": {
    "php": ">=5.5",
    "phpunit/phpunit": ">4,<6"
},

inside my composer.json file:

https://github.com/giorgiosironi/eris/blob/master/composer.json#L20

composer install however still accepts to be run on hhvm, as seen at:

https://travis-ci.org/giorgiosironi/eris/jobs/118241849

I thought requiring php meant I wanted a particular version of php, so hhvm was excluded. It seems instead that this choice means that if there is a php present, it must satisfy the version constraint, but if there is only hhvm it won't apply.

Is this what is happening? If so, how can I specify the package is incompatible with hhvm?

Upvotes: 1

Views: 975

Answers (3)

user3477804
user3477804

Reputation:

You can use the conflict option to say that your package conflicts with HHVM. This would look like

"conflict": {
  "hhvm": "*"
}

which sets your package as conflicting with every version of HHVM.

Upvotes: 1

David J Eddy
David J Eddy

Reputation: 2037

Nope, if php is in the required array is MUST be installed and be at least the version specified. As @Evert stated HHVM provides a php version when queried.

Check this out for hhvm dependency: https://getcomposer.org/doc/02-libraries.md#platform-packages

Upvotes: 0

Evert
Evert

Reputation: 99717

HHVM emits the PHP_VERSION constants. I'm fairly sure that composer simply uses those constants to figure out the version here.

My understanding is that HHVM has increased their PHP_VERSION as they obtained feature parity with the associated vanilla php version.

Upvotes: 0

Related Questions