|
|
|
@ -51,14 +51,14 @@ class RuleSetGenerator
|
|
|
|
|
*/
|
|
|
|
|
protected function createRequireRule(PackageInterface $package, array $providers, $reason, $reasonData = null)
|
|
|
|
|
{
|
|
|
|
|
$literals = array(-$package->getId());
|
|
|
|
|
$literals = array(-$package->id);
|
|
|
|
|
|
|
|
|
|
foreach ($providers as $provider) {
|
|
|
|
|
// self fulfilling rule?
|
|
|
|
|
if ($provider === $package) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
$literals[] = $provider->getId();
|
|
|
|
|
$literals[] = $provider->id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new Rule($this->pool, $literals, $reason, $reasonData);
|
|
|
|
@ -80,7 +80,7 @@ class RuleSetGenerator
|
|
|
|
|
{
|
|
|
|
|
$literals = array();
|
|
|
|
|
foreach ($packages as $package) {
|
|
|
|
|
$literals[] = $package->getId();
|
|
|
|
|
$literals[] = $package->id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new Rule($this->pool, $literals, $reason, $job['packageName'], $job);
|
|
|
|
@ -99,7 +99,7 @@ class RuleSetGenerator
|
|
|
|
|
*/
|
|
|
|
|
protected function createRemoveRule(PackageInterface $package, $reason, $job)
|
|
|
|
|
{
|
|
|
|
|
return new Rule($this->pool, array(-$package->getId()), $reason, $job['packageName'], $job);
|
|
|
|
|
return new Rule($this->pool, array(-$package->id), $reason, $job['packageName'], $job);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -123,7 +123,7 @@ class RuleSetGenerator
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new Rule($this->pool, array(-$issuer->getId(), -$provider->getId()), $reason, $reasonData);
|
|
|
|
|
return new Rule($this->pool, array(-$issuer->id, -$provider->id), $reason, $reasonData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -151,11 +151,11 @@ class RuleSetGenerator
|
|
|
|
|
|
|
|
|
|
while (!$workQueue->isEmpty()) {
|
|
|
|
|
$package = $workQueue->dequeue();
|
|
|
|
|
if (isset($this->whitelistedMap[$package->getId()])) {
|
|
|
|
|
if (isset($this->whitelistedMap[$package->id])) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->whitelistedMap[$package->getId()] = true;
|
|
|
|
|
$this->whitelistedMap[$package->id] = true;
|
|
|
|
|
|
|
|
|
|
foreach ($package->getRequires() as $link) {
|
|
|
|
|
$possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint(), true);
|
|
|
|
@ -186,11 +186,11 @@ class RuleSetGenerator
|
|
|
|
|
|
|
|
|
|
while (!$workQueue->isEmpty()) {
|
|
|
|
|
$package = $workQueue->dequeue();
|
|
|
|
|
if (isset($this->addedMap[$package->getId()])) {
|
|
|
|
|
if (isset($this->addedMap[$package->id])) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->addedMap[$package->getId()] = true;
|
|
|
|
|
$this->addedMap[$package->id] = true;
|
|
|
|
|
|
|
|
|
|
foreach ($package->getRequires() as $link) {
|
|
|
|
|
if ($ignorePlatformReqs && preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) {
|
|
|
|
@ -215,7 +215,7 @@ class RuleSetGenerator
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check obsoletes and implicit obsoletes of a package
|
|
|
|
|
$isInstalled = (isset($this->installedMap[$package->getId()]));
|
|
|
|
|
$isInstalled = (isset($this->installedMap[$package->id]));
|
|
|
|
|
|
|
|
|
|
foreach ($package->getReplaces() as $link) {
|
|
|
|
|
$obsoleteProviders = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
|
|
|
|
@ -289,7 +289,7 @@ class RuleSetGenerator
|
|
|
|
|
$packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
|
|
|
|
|
if ($packages) {
|
|
|
|
|
foreach ($packages as $package) {
|
|
|
|
|
if (!isset($this->installedMap[$package->getId()])) {
|
|
|
|
|
if (!isset($this->installedMap[$package->id])) {
|
|
|
|
|
$this->addRulesForPackage($package, $ignorePlatformReqs);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|