Fixed PoolBuilder running endlessly when packages do not exist
parent
28f82032cd
commit
bca88bdd4b
|
@ -249,6 +249,8 @@ class PoolBuilder
|
||||||
$this->loadedNames[$name] = $constraint;
|
$this->loadedNames[$name] = $constraint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$preLoad = $this->packagesToLoad;
|
||||||
|
|
||||||
foreach ($repositories as $repository) {
|
foreach ($repositories as $repository) {
|
||||||
if (empty($this->packagesToLoad)) {
|
if (empty($this->packagesToLoad)) {
|
||||||
break;
|
break;
|
||||||
|
@ -271,9 +273,11 @@ class PoolBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we empty the packagesToLoad here as it would result
|
// Make sure we empty the packagesToLoad here as it would result
|
||||||
// in an endless loop with non-existent packages for example
|
// in an endless loop if the array remains unchanged.
|
||||||
// TODO: fixme, this should only happen if it's not a new package
|
// This could happen with non-existent packages for example.
|
||||||
// $this->packagesToLoad = array();
|
if ($preLoad == $this->packagesToLoad) {
|
||||||
|
$this->packagesToLoad = array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadPackage(Request $request, PackageInterface $package, $propagateUpdate = true)
|
private function loadPackage(Request $request, PackageInterface $package, $propagateUpdate = true)
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
--TEST--
|
||||||
|
Test irrelevant package versions are not loaded
|
||||||
|
|
||||||
|
--REQUEST--
|
||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"root/req": "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--FIXED--
|
||||||
|
[
|
||||||
|
]
|
||||||
|
|
||||||
|
--PACKAGES--
|
||||||
|
[
|
||||||
|
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||||
|
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep3": "2.*"}}
|
||||||
|
]
|
||||||
|
|
||||||
|
--EXPECT--
|
||||||
|
[
|
||||||
|
"root/req-1.0.0.0",
|
||||||
|
"dep/dep-2.3.4.0"
|
||||||
|
]
|
Loading…
Reference in New Issue