1
0
Fork 0

Only generate lock file when actually necessary, fixes #1064

pull/1018/merge
Jordi Boggiano 2012-09-04 20:05:59 +02:00
parent e0dc045955
commit 10d1a4382f
1 changed files with 8 additions and 0 deletions

View File

@ -198,6 +198,14 @@ class Locker
$lock['packages-dev'] = $this->lockPackages($devPackages); $lock['packages-dev'] = $this->lockPackages($devPackages);
} }
if (empty($lock['packages']) && empty($lock['packages-dev'])) {
if ($this->lockFile->exists()) {
unlink($this->lockFile->getPath());
}
return false;
}
if (!$this->isLocked() || $lock !== $this->getLockData()) { if (!$this->isLocked() || $lock !== $this->getLockData()) {
$this->lockFile->write($lock); $this->lockFile->write($lock);
$this->lockDataCache = null; $this->lockDataCache = null;