1
0
Fork 0

Do not throw exception on install --dev with old lock files if composer.json has no require-dev

pull/1779/head
Jordi Boggiano 2013-04-05 15:01:18 +02:00
parent 0a561d7bf1
commit b519d65bff
1 changed files with 10 additions and 1 deletions

View File

@ -295,7 +295,16 @@ class Installer
$installFromLock = false;
if (!$this->update && $this->locker->isLocked()) {
$installFromLock = true;
try {
$lockedRepository = $this->locker->getLockedRepository($withDevReqs);
} catch (\RuntimeException $e) {
// if there are dev requires, then we really can not install
if ($this->package->getDevRequires()) {
throw $e;
}
// no require-dev in composer.json and the lock file was created with no dev info, so skip them
$lockedRepository = $this->locker->getLockedRepository();
}
}
$this->whitelistUpdateDependencies(