1
0
Fork 0

Reset package IDs before they can be used in the pool in case there are already some in the cache

pull/1168/head
Jordi Boggiano 2012-10-18 12:57:55 +02:00
parent 541bcabbc0
commit 5978197b5d
2 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,7 @@ class Pool
if ($repo instanceof ComposerRepository && $repo->hasProviders()) { if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
$this->composerRepos[] = $repo; $this->composerRepos[] = $repo;
$repo->resetPackageIds();
} elseif ($repo instanceof StreamableRepositoryInterface) { } elseif ($repo instanceof StreamableRepositoryInterface) {
foreach ($repo->getMinimalPackages() as $package) { foreach ($repo->getMinimalPackages() as $package) {
$name = $package['name']; $name = $package['name'];

View File

@ -199,6 +199,13 @@ class ComposerRepository extends ArrayRepository implements NotifiableRepository
return $this->hasProviders; return $this->hasProviders;
} }
public function resetPackageIds()
{
foreach ($this->providersByUid as $package) {
$package->setId(-1);
}
}
public function whatProvides(Pool $pool, $name) public function whatProvides(Pool $pool, $name)
{ {
// skip platform packages // skip platform packages