1
0
Fork 0

Merge branch '2.5'

pull/11459/head
Jordi Boggiano 2023-05-05 14:16:14 +02:00
commit cbb7319963
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}
} }
} }