Respect current PHP version when figuring out requirements for init command, fixes #7257
parent
174c71de04
commit
5460e5d86f
|
@ -319,11 +319,16 @@ EOT
|
||||||
|
|
||||||
$io->writeError(array('', 'Define your dependencies.', ''));
|
$io->writeError(array('', 'Define your dependencies.', ''));
|
||||||
|
|
||||||
|
// prepare to resolve dependencies
|
||||||
|
$repos = $this->getRepos();
|
||||||
|
$preferredStability = $minimumStability ?: 'stable';
|
||||||
|
$phpVersion = $repos->findPackage('php', '*')->getPrettyVersion();
|
||||||
|
|
||||||
$question = 'Would you like to define your dependencies (require) interactively [<comment>yes</comment>]? ';
|
$question = 'Would you like to define your dependencies (require) interactively [<comment>yes</comment>]? ';
|
||||||
$require = $input->getOption('require');
|
$require = $input->getOption('require');
|
||||||
$requirements = array();
|
$requirements = array();
|
||||||
if ($require || $io->askConfirmation($question, true)) {
|
if ($require || $io->askConfirmation($question, true)) {
|
||||||
$requirements = $this->determineRequirements($input, $output, $require);
|
$requirements = $this->determineRequirements($input, $output, $require, $phpVersion, $preferredStability);
|
||||||
}
|
}
|
||||||
$input->setOption('require', $requirements);
|
$input->setOption('require', $requirements);
|
||||||
|
|
||||||
|
@ -331,7 +336,7 @@ EOT
|
||||||
$requireDev = $input->getOption('require-dev');
|
$requireDev = $input->getOption('require-dev');
|
||||||
$devRequirements = array();
|
$devRequirements = array();
|
||||||
if ($requireDev || $io->askConfirmation($question, true)) {
|
if ($requireDev || $io->askConfirmation($question, true)) {
|
||||||
$devRequirements = $this->determineRequirements($input, $output, $requireDev);
|
$devRequirements = $this->determineRequirements($input, $output, $requireDev, $phpVersion, $preferredStability);
|
||||||
}
|
}
|
||||||
$input->setOption('require-dev', $devRequirements);
|
$input->setOption('require-dev', $devRequirements);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue