|
|
@ -40,8 +40,8 @@ class InitCommand extends BaseCommand
|
|
|
|
/** @var array */
|
|
|
|
/** @var array */
|
|
|
|
private $gitConfig;
|
|
|
|
private $gitConfig;
|
|
|
|
|
|
|
|
|
|
|
|
/** @var Pool */
|
|
|
|
/** @var Pool[] */
|
|
|
|
private $pool;
|
|
|
|
private $pools;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
* {@inheritdoc}
|
|
|
@ -627,12 +627,14 @@ EOT
|
|
|
|
|
|
|
|
|
|
|
|
private function getPool(InputInterface $input, $minimumStability = null)
|
|
|
|
private function getPool(InputInterface $input, $minimumStability = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!$this->pool) {
|
|
|
|
$key = $minimumStability ?: 'default';
|
|
|
|
$this->pool = new Pool($minimumStability ?: $this->getMinimumStability($input));
|
|
|
|
|
|
|
|
$this->pool->addRepository($this->getRepos());
|
|
|
|
if (!isset($this->pools[$key])) {
|
|
|
|
|
|
|
|
$this->pools[$key] = $pool = new Pool($minimumStability ?: $this->getMinimumStability($input));
|
|
|
|
|
|
|
|
$pool->addRepository($this->getRepos());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $this->pool;
|
|
|
|
return $this->pools[$key];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function getMinimumStability(InputInterface $input)
|
|
|
|
private function getMinimumStability(InputInterface $input)
|
|
|
@ -671,13 +673,14 @@ EOT
|
|
|
|
$package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability);
|
|
|
|
$package = $versionSelector->findBestCandidate($name, $requiredVersion, $phpVersion, $preferredStability);
|
|
|
|
|
|
|
|
|
|
|
|
if (!$package) {
|
|
|
|
if (!$package) {
|
|
|
|
|
|
|
|
// Check whether the PHP version was the problem
|
|
|
|
|
|
|
|
if ($phpVersion && $versionSelector->findBestCandidate($name, $requiredVersion, null, $preferredStability)) {
|
|
|
|
|
|
|
|
throw new \InvalidArgumentException(sprintf(
|
|
|
|
|
|
|
|
'Package %s at version %s has a PHP requirement incompatible with your PHP version (%s)', $name, $requiredVersion, $phpVersion
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check whether the required version was the problem
|
|
|
|
if ($requiredVersion && $versionSelector->findBestCandidate($name, null, $phpVersion, $preferredStability)) {
|
|
|
|
if ($requiredVersion && $versionSelector->findBestCandidate($name, null, $phpVersion, $preferredStability)) {
|
|
|
|
// Check whether the PHP version was the problem
|
|
|
|
|
|
|
|
if ($phpVersion && $versionSelector->findBestCandidate($name, null, null, $preferredStability)) {
|
|
|
|
|
|
|
|
throw new \InvalidArgumentException(sprintf(
|
|
|
|
|
|
|
|
'Package %s at version %s has a PHP requirement incompatible with your PHP version (%s)', $name, $requiredVersion, $phpVersion
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new \InvalidArgumentException(sprintf(
|
|
|
|
throw new \InvalidArgumentException(sprintf(
|
|
|
|
'Could not find package %s in a version matching %s', $name, $requiredVersion
|
|
|
|
'Could not find package %s in a version matching %s', $name, $requiredVersion
|
|
|
|
));
|
|
|
|
));
|
|
|
|