phar-io / phive

The Phar Installation and Verification Environment (PHIVE)
https://phar.io
BSD 3-Clause "New" or "Revised" License
580 stars 45 forks source link

Consider Options to support different versions of a package based on requirements #101

Open theseer opened 7 years ago

theseer commented 7 years ago

Currently, we can either install a fixed version or whatever is latest. Depending on the runtime environment, this may be not good enough. For instance PHPUnit 6.x will not work with PHP 5.6, PHPUnit 5 won't work on the EOL'd PHP 5.3.

Or don't we care?

sebastianheuer commented 7 years ago

Idea:

We allow multiple version constraints per phar in phive.xml, where each constraint has platform conditions.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
  <phar name="phpab" version="^1.23" installed="1.23.0" location="./tools/phpab"/>
  <phar name="phpunit" location="./tools/phpunit">
    <condition php="^5.6" version="^5.6" installed="5.7.3"/>
    <condition php="^7.0" version="^6.0" installed="6.1.0"/>
  </phar>
</phive>