|
|
|
@ -26,7 +26,6 @@ class RuleSetGenerator
|
|
|
|
|
protected $rules;
|
|
|
|
|
protected $jobs;
|
|
|
|
|
protected $installedMap;
|
|
|
|
|
protected $whitelistedMap;
|
|
|
|
|
protected $addedMap;
|
|
|
|
|
protected $conflictAddedMap;
|
|
|
|
|
protected $addedPackages;
|
|
|
|
@ -147,41 +146,6 @@ class RuleSetGenerator
|
|
|
|
|
$this->rules->add($newRule, $type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function whitelistFromPackage(PackageInterface $package)
|
|
|
|
|
{
|
|
|
|
|
$workQueue = new \SplQueue;
|
|
|
|
|
$workQueue->enqueue($package);
|
|
|
|
|
|
|
|
|
|
while (!$workQueue->isEmpty()) {
|
|
|
|
|
$package = $workQueue->dequeue();
|
|
|
|
|
if (isset($this->whitelistedMap[$package->id])) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->whitelistedMap[$package->id] = true;
|
|
|
|
|
|
|
|
|
|
foreach ($package->getRequires() as $link) {
|
|
|
|
|
$possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint(), true);
|
|
|
|
|
|
|
|
|
|
foreach ($possibleRequires as $require) {
|
|
|
|
|
$workQueue->enqueue($require);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$obsoleteProviders = $this->pool->whatProvides($package->getName(), null, true);
|
|
|
|
|
|
|
|
|
|
foreach ($obsoleteProviders as $provider) {
|
|
|
|
|
if ($provider === $package) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (($package instanceof AliasPackage) && $package->getAliasOf() === $provider) {
|
|
|
|
|
$workQueue->enqueue($provider);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function addRulesForPackage(PackageInterface $package, $ignorePlatformReqs)
|
|
|
|
|
{
|
|
|
|
|
$workQueue = new \SplQueue;
|
|
|
|
@ -290,20 +254,6 @@ class RuleSetGenerator
|
|
|
|
|
return $impossible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function whitelistFromJobs()
|
|
|
|
|
{
|
|
|
|
|
foreach ($this->jobs as $job) {
|
|
|
|
|
switch ($job['cmd']) {
|
|
|
|
|
case 'install':
|
|
|
|
|
$packages = $this->pool->whatProvides($job['packageName'], $job['constraint'], true);
|
|
|
|
|
foreach ($packages as $package) {
|
|
|
|
|
$this->whitelistFromPackage($package);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function addRulesForJobs($ignorePlatformReqs)
|
|
|
|
|
{
|
|
|
|
|
foreach ($this->jobs as $job) {
|
|
|
|
@ -344,14 +294,6 @@ class RuleSetGenerator
|
|
|
|
|
$this->rules = new RuleSet;
|
|
|
|
|
$this->installedMap = $installedMap;
|
|
|
|
|
|
|
|
|
|
$this->whitelistedMap = array();
|
|
|
|
|
foreach ($this->installedMap as $package) {
|
|
|
|
|
$this->whitelistFromPackage($package);
|
|
|
|
|
}
|
|
|
|
|
$this->whitelistFromJobs();
|
|
|
|
|
|
|
|
|
|
$this->pool->setWhitelist($this->whitelistedMap);
|
|
|
|
|
|
|
|
|
|
$this->addedMap = array();
|
|
|
|
|
$this->conflictAddedMap = array();
|
|
|
|
|
$this->addedPackages = array();
|
|
|
|
|