diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-27 13:32:25 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-27 13:32:25 +0200 |
commit | 59b56c2283c12c8a82144a836faee4f12b15e5c1 (patch) | |
tree | 1d6930b8799f37b2023231d0db253b8a980807d8 /includes/util | |
parent | 633c92eae865e957121e08de634aeee11a8b3992 (diff) | |
download | pluralconnect-59b56c2283c12c8a82144a836faee4f12b15e5c1.tar.gz pluralconnect-59b56c2283c12c8a82144a836faee4f12b15e5c1.tar.bz2 pluralconnect-59b56c2283c12c8a82144a836faee4f12b15e5c1.zip |
Updated 5 files and deleted 2 files (automated)
Diffstat (limited to 'includes/util')
-rw-r--r-- | includes/util/functions.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/util/functions.inc b/includes/util/functions.inc index 79a47c6..fe97980 100644 --- a/includes/util/functions.inc +++ b/includes/util/functions.inc @@ -3,17 +3,17 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/homepage.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/random.inc"; if (!function_exists("createJob")) { function createJob($title, $options) { - $jobs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/jobs.json"), true); - $jobs[] = [ + $job = [ "name" => $title, "options" => $options, "date" => date('c') ]; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/jobs.json", json_encode($jobs)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/jobs/" . round(microtime(true) * 1000) . "-" . random() . ".json", json_encode($job)); } } |