1
0
Fork 0

Follow ignore-platform-reqs when checking for package requirements, fixes #6859

pull/6969/head
Jordi Boggiano 2018-01-03 15:02:32 +01:00
parent e2ad3ea85a
commit 8a50345df7
1 changed files with 8 additions and 1 deletions

View File

@ -660,8 +660,9 @@ EOT
*
* @param InputInterface $input
* @param string $name
* @param string $phpVersion
* @param string|null $phpVersion
* @param string $preferredStability
* @param string|null $requiredVersion
* @param string $minimumStability
* @throws \InvalidArgumentException
* @return string
@ -672,6 +673,12 @@ EOT
$versionSelector = new VersionSelector($this->getPool($input, $minimumStability));
$package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability);
// retry without phpVersion if platform requirements are ignored in case nothing was found
if ($input->hasOption('ignore-platform-reqs') && $input->getOption('ignore-platform-reqs')) {
$phpVersion = null;
$package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability);
}
if (!$package) {
// Check whether the PHP version was the problem
if ($phpVersion && $versionSelector->findBestCandidate($name, $requiredVersion, null, $preferredStability)) {