Fix lock file being more recent than vendor dir when require guesses the constraint after resolution, fixes #11405
parent
766628a8d4
commit
2d2d22d0ec
|
@ -551,10 +551,15 @@ EOT
|
||||||
if (false === $contents) {
|
if (false === $contents) {
|
||||||
throw new \RuntimeException('Unable to read '.$this->json->getPath().' contents to update the lock file hash.');
|
throw new \RuntimeException('Unable to read '.$this->json->getPath().' contents to update the lock file hash.');
|
||||||
}
|
}
|
||||||
$lock = new JsonFile(Factory::getLockFile($this->json->getPath()));
|
$lockFile = Factory::getLockFile($this->json->getPath());
|
||||||
|
$lockMtime = filemtime($lockFile);
|
||||||
|
$lock = new JsonFile($lockFile);
|
||||||
$lockData = $lock->read();
|
$lockData = $lock->read();
|
||||||
$lockData['content-hash'] = Locker::getContentHash($contents);
|
$lockData['content-hash'] = Locker::getContentHash($contents);
|
||||||
$lock->write($lockData);
|
$lock->write($lockData);
|
||||||
|
if (is_int($lockMtime)) {
|
||||||
|
@touch($lockFile, $lockMtime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue