1
0
Fork 0

Ensure missing packages are reinstalled if they are deleted from the filesystem, fixes #355, fixes #437

pull/454/merge
Jordi Boggiano 2012-03-15 00:56:04 +01:00
parent 76e49aa36c
commit 96b07ffb7b
1 changed files with 7 additions and 0 deletions

View File

@ -104,6 +104,13 @@ class Factory
// initialize installation manager
$im = $this->createInstallationManager($rm, $dm, $vendorDir, $binDir, $io);
// purge packages if they have been deleted on the filesystem
foreach ($rm->getLocalRepository()->getPackages() as $package) {
if (!$im->isPackageInstalled($package)) {
$rm->getLocalRepository()->removePackage($package);
}
}
// init locker
$lockFile = substr($composerFile, -5) === '.json' ? substr($composerFile, 0, -4).'lock' : $composerFile . '.lock';
$locker = new Package\Locker(new JsonFile($lockFile), $rm, md5_file($composerFile));