From a2df9a69dcc14cb70118cda2ded499055e7ee358 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 21 Aug 2022 17:31:56 +0200 Subject: m. update --- api/cloudburst-data.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 api/cloudburst-data.php (limited to 'api/cloudburst-data.php') diff --git a/api/cloudburst-data.php b/api/cloudburst-data.php new file mode 100644 index 0000000..f1bab0b --- /dev/null +++ b/api/cloudburst-data.php @@ -0,0 +1,44 @@ + null, + "content" => null + ]; + if ($parts[1] === "metadata") { + $data["members"][$parts[0]][$parts[1]] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true)); + } else { + $data["members"][$parts[0]][$parts[1]] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true); + } + } else { + $data[$name] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true); + } + } else { + if (strlen($parts[0]) === 5) { + if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [ + "metadata" => null, + "content" => null + ]; + $data["members"][$parts[0]][$parts[1]] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file); + } else { + $data[$name] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file); + } + } + } +} + +header("Content-Type: application/json"); +die(json_encode($data, JSON_PRETTY_PRINT)); \ No newline at end of file -- cgit