1
0
Fork 0

Take php version into account for create-project command version selection

pull/4564/merge
Jordi Boggiano 2015-10-29 22:35:01 +00:00
parent c7ed232ef4
commit ef2856ef55
1 changed files with 4 additions and 1 deletions

View File

@ -276,9 +276,12 @@ EOT
$pool = new Pool($stability);
$pool->addRepository($sourceRepo);
// using those 3 constants to build a version without the 'extra' bit that can contain garbage
$phpVersion = PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;
// find the latest version if there are multiple
$versionSelector = new VersionSelector($pool);
$package = $versionSelector->findBestCandidate($name, $packageVersion);
$package = $versionSelector->findBestCandidate($name, $packageVersion, $phpVersion);
if (!$package) {
throw new \InvalidArgumentException("Could not find package $name" . ($packageVersion ? " with version $packageVersion." : " with stability $stability."));