diff options
author | Andrew Dolgov <[email protected]> | 2020-09-22 09:04:33 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-09-22 09:04:33 +0300 |
commit | 74568df4ff7b7788991636f6fb2ed62012f85c3b (patch) | |
tree | 673bcb01157b38e4b38f8f4c8227012e8a750e18 /update.php | |
parent | d04ac399ff284e9747e3fb55e87d05e0a5b8d85f (diff) |
remove a lot of stuff from global context (functions.php), add a few helper classes instead
Diffstat (limited to 'update.php')
-rwxr-xr-x | update.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/update.php b/update.php index 881db3621..8b325d7bb 100755 --- a/update.php +++ b/update.php @@ -14,6 +14,19 @@ require_once "db.php"; require_once "db-prefs.php"; + function make_stampfile($filename) { + $fp = fopen(LOCK_DIRECTORY . "/$filename", "w"); + + if (flock($fp, LOCK_EX | LOCK_NB)) { + fwrite($fp, time() . "\n"); + flock($fp, LOCK_UN); + fclose($fp); + return true; + } else { + return false; + } + } + function cleanup_tags($days = 14, $limit = 1000) { $days = (int) $days; |