1
0
Fork 0

Respect current PHP version when figuring out requirements for init command, fixes #7257

pull/7096/merge
Jordi Boggiano 2018-04-12 16:22:40 +02:00
parent 174c71de04
commit 5460e5d86f
1 changed files with 7 additions and 2 deletions

View File

@ -319,11 +319,16 @@ EOT
$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>]? ';
$require = $input->getOption('require');
$requirements = array();
if ($require || $io->askConfirmation($question, true)) {
$requirements = $this->determineRequirements($input, $output, $require);
$requirements = $this->determineRequirements($input, $output, $require, $phpVersion, $preferredStability);
}
$input->setOption('require', $requirements);
@ -331,7 +336,7 @@ EOT
$requireDev = $input->getOption('require-dev');
$devRequirements = array();
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);
}