diff options
author | Minteck <contact@minteck.org> | 2021-12-04 15:42:09 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-04 15:42:09 +0100 |
commit | efadd6eda15122944d95e1b3f01c3f4c35d1f40a (patch) | |
tree | 7adce217645cdd220118c58cebc3dc129922edb2 /includes/telemetry.php | |
parent | 79d295f26659dd3b6aea93bb64803bf0778a8f84 (diff) | |
download | main-efadd6eda15122944d95e1b3f01c3f4c35d1f40a.tar.gz main-efadd6eda15122944d95e1b3f01c3f4c35d1f40a.tar.bz2 main-efadd6eda15122944d95e1b3f01c3f4c35d1f40a.zip |
Commit
Diffstat (limited to 'includes/telemetry.php')
-rw-r--r-- | includes/telemetry.php | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/includes/telemetry.php b/includes/telemetry.php index 3988679..e69de29 100644 --- a/includes/telemetry.php +++ b/includes/telemetry.php @@ -1,30 +0,0 @@ -<?php - -$db = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.json"), true); - -$ip = md5($_SERVER['REMOTE_ADDR']); -$day = date('d'); -$month = date('m'); -$year = date('y'); -$url = "space:" .explode("?", $_SERVER['REQUEST_URI'])[0]; - -if (!isset($db[$year]) && $_SERVER['PHP_SELF'] !== "/404.php") { - $db[$year] = []; -} -if (!isset($db[$year][$month]) && $_SERVER['PHP_SELF'] !== "/404.php") { - $db[$year][$month] = []; -} -if (!isset($db[$year][$month][$day]) && $_SERVER['PHP_SELF'] !== "/404.php") { - $db[$year][$month][$day] = []; -} -if (!isset($db[$year][$month][$day][$url]) && $_SERVER['PHP_SELF'] !== "/404.php") { - $db[$year][$month][$day][$url] = []; -} - -if (!in_array($ip, $db[$year][$month][$day][$url]) && $_SERVER['PHP_SELF'] !== "/404.php") { - array_push($db[$year][$month][$day][$url], $ip); -} - -if (trim(json_encode($db, JSON_PRETTY_PRINT)) !== "null") { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.json", json_encode($db, JSON_PRETTY_PRINT)); -}
\ No newline at end of file |