install&update add lock file

This commit is contained in:
xiaomlove
2022-04-17 16:59:59 +08:00
parent e0a515b66c
commit 425402b46b
3 changed files with 16 additions and 0 deletions

View File

@@ -632,4 +632,16 @@ class Install
return compact('version', 'match');
}
public function checkLock($path)
{
if (file_exists("$path/.lock")) {
die("Locked! Delete .lock file first");
}
}
public function setLock($path)
{
file_put_contents("$path/.lock", "Lock at: " . date('Y-m-d H:i:s'));
}
}