Create pool in show command to use policy, remove todos
parent
b6e2d60c9e
commit
1747df97e7
|
@ -539,9 +539,11 @@ EOT
|
|||
$matches[$index] = $package->getId();
|
||||
}
|
||||
|
||||
$pool = $repositorySet->createPool();
|
||||
|
||||
// select preferred package according to policy rules
|
||||
if (!$matchedPackage && $matches && $preferred = $policy->selectPreferredPackages($repositorySet->getPoolTemp(), array(), $matches)) { // TODO get rid of the pool call
|
||||
$matchedPackage = $repositorySet->getPoolTemp()->literalToPackage($preferred[0]);
|
||||
if (!$matchedPackage && $matches && $preferred = $policy->selectPreferredPackages($pool, array(), $matches)) {
|
||||
$matchedPackage = $pool->literalToPackage($preferred[0]);
|
||||
}
|
||||
|
||||
return array($matchedPackage, $versions);
|
||||
|
|
|
@ -127,7 +127,7 @@ class Installer
|
|||
* @var array|null
|
||||
*/
|
||||
protected $updateWhitelist = null;
|
||||
protected $whitelistDependencies = false; // TODO 2.0 rename to whitelistTransitiveDependencies
|
||||
protected $whitelistTransitiveDependencies = false;
|
||||
protected $whitelistAllDependencies = false;
|
||||
|
||||
/**
|
||||
|
@ -1327,7 +1327,7 @@ class Installer
|
|||
foreach ($this->updateWhitelist as $packageName => $void) {
|
||||
$packageQueue = new \SplQueue;
|
||||
|
||||
$depPackages = $repositorySet->findPackages($packageName); // TODO does this need replacers/providers?
|
||||
$depPackages = $repositorySet->findPackages($packageName, null, false);
|
||||
|
||||
$nameMatchesRequiredPackage = in_array($packageName, $requiredPackageNames, true);
|
||||
|
||||
|
@ -1359,14 +1359,14 @@ class Installer
|
|||
$seen[spl_object_hash($package)] = true;
|
||||
$this->updateWhitelist[$package->getName()] = true;
|
||||
|
||||
if (!$this->whitelistDependencies && !$this->whitelistAllDependencies) {
|
||||
if (!$this->whitelistTransitiveDependencies && !$this->whitelistAllDependencies) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$requires = $package->getRequires();
|
||||
|
||||
foreach ($requires as $require) {
|
||||
$requirePackages = $repositorySet->findPackages($require->getTarget()); // TODO does this need replacers/providers?
|
||||
$requirePackages = $repositorySet->findPackages($require->getTarget(), null, false);
|
||||
|
||||
foreach ($requirePackages as $requirePackage) {
|
||||
if (isset($this->updateWhitelist[$requirePackage->getName()])) {
|
||||
|
@ -1678,7 +1678,7 @@ class Installer
|
|||
*/
|
||||
public function setWhitelistTransitiveDependencies($updateTransitiveDependencies = true)
|
||||
{
|
||||
$this->whitelistDependencies = (bool) $updateTransitiveDependencies;
|
||||
$this->whitelistTransitiveDependencies = (bool) $updateTransitiveDependencies;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue