I love the idea of inferring default extensions to install from composer.json. I would like to have the same functionality for inferring default PHP version itself as well. At the moment, it's always defaulting to PHP 8.1, no matter what is in composer.json. I suggest to parse require.php from composer.json and detect minimum version from there. My initial attempt is
builtins.replaceStrings ["."] [""] (
builtins.head (
builtins.match ".*([[:digit:]]\.[[:digit:]])"
(
builtins.fromJSON (
builtins.readFile "${builtins.getEnv "PWD"}/composer.json"
)
)
.require
.php
)
)
but this ought to be improved, because this doesn't handle values like ^7.4 || ^8.0
I love the idea of inferring default extensions to install from composer.json. I would like to have the same functionality for inferring default PHP version itself as well. At the moment, it's always defaulting to PHP 8.1, no matter what is in composer.json. I suggest to parse
require.phpfromcomposer.jsonand detect minimum version from there. My initial attempt isbut this ought to be improved, because this doesn't handle values like
^7.4 || ^8.0