summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-22 09:04:33 +0300
committerAndrew Dolgov <[email protected]>2020-09-22 09:04:33 +0300
commit74568df4ff7b7788991636f6fb2ed62012f85c3b (patch)
tree673bcb01157b38e4b38f8f4c8227012e8a750e18 /update.php
parentd04ac399ff284e9747e3fb55e87d05e0a5b8d85f (diff)
remove a lot of stuff from global context (functions.php), add a few helper classes instead
Diffstat (limited to 'update.php')
-rwxr-xr-xupdate.php13
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;