blob: 26b655a65a541f8ff0499df5c78afc99e1356f2e [file] [log] [blame]
<?php
require_once("config.php");
class write {
public static function funct($json) {
print_r(json_encode($json));
exit();
}
public static function error($n, $msg) {
self::funct(["error" => $n, "msg" => $msg]);
}
}
function get_graph() {
global $conf;
return json_decode(file_get_contents($conf["apiurl"]), true);
}
if (!isset($_GET["action"])) {
write::error(1, "No action provided");
}
switch ($_GET["action"]) {
case "getgraf":
$graf = file_get_contents($conf["apiurl"]);
echo $graf;
break;
default:
write::error(2, "Unknown action");
}
?>