From 704e1c22efe6056b0fc2f59b2766f47e1c8d71cc Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Mon, 3 Apr 2023 22:22:48 +0200 Subject: Updated 19 files and added 12 files (automated) --- includes/jobs/PKSystem.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'includes/jobs/PKSystem.php') diff --git a/includes/jobs/PKSystem.php b/includes/jobs/PKSystem.php index 045eb67..6583e4f 100644 --- a/includes/jobs/PKSystem.php +++ b/includes/jobs/PKSystem.php @@ -5,10 +5,13 @@ $_SERVER['DOCUMENT_ROOT'] = "../.."; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php'; use ColorThief\ColorThief; +echo("Loading...\n"); + $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); $system = $options["system"]; if ($app["other"]["id"] === $system) { + echo("Using authentication\n"); $ctx = stream_context_create([ 'http' => [ 'method' => 'GET', @@ -17,6 +20,7 @@ if ($app["other"]["id"] === $system) { ] ]); } else { + echo("Not using authentication\n"); $ctx = stream_context_create([ 'http' => [ 'method' => 'GET' @@ -24,8 +28,12 @@ if ($app["other"]["id"] === $system) { ]); } +echo("Fetching...\n"); $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$system", false, $ctx); if (trim($data) !== "" && $data !== false) { + echo("Data is valid, saved it\n"); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/general.json", $data); +} else { + echo("Data is invalid\n"); } \ No newline at end of file -- cgit