1
0
Fork 0

Fix BC issue from #3101

pull/3137/head
Jordi Boggiano 2014-07-19 19:43:59 +02:00
parent 4f0d7e4739
commit 4bd748b463
2 changed files with 13 additions and 2 deletions

View File

@ -648,7 +648,17 @@ class Installer
private function createPolicy()
{
return new DefaultPolicy((!$this->update && $this->locker->isLocked()) ? $this->locker->getPreferStable() : $this->package->getPreferStable());
$preferStable = null;
if (!$this->update && $this->locker->isLocked()) {
$preferStable = $this->locker->getPreferStable();
}
// old lock file without prefer stable will return null
// so in this case we use the composer.json info
if (null === $preferStable) {
$preferStable = $this->package->getPreferStable();
}
return new DefaultPolicy($preferStable);
}
private function createRequest(Pool $pool, RootPackageInterface $rootPackage, PlatformRepository $platformRepo)

View File

@ -177,7 +177,7 @@ class Locker
{
$lockData = $this->getLockData();
return isset($lockData['prefer-stable']) ? $lockData['prefer-stable'] : false;
return isset($lockData['prefer-stable']) ? $lockData['prefer-stable'] : null;
}
public function getAliases()
@ -210,6 +210,7 @@ class Locker
* @param array $aliases array of aliases
* @param string $minimumStability
* @param array $stabilityFlags
* @param bool $preferStable
*
* @return bool
*/