blob: 756ee4889f7903222131a065db4398e048ed44d6 [file] [log] [blame]
avm99963f0d15212017-10-08 17:03:22 +02001<?php
avm99963658fae52017-10-08 23:09:16 +02002require_once("config.php");
3
avm99963f0d15212017-10-08 17:03:22 +02004class write {
Huguet57e9f47652018-07-23 03:28:12 +02005 public static function funct($json) {
avm99963f0d15212017-10-08 17:03:22 +02006 print_r(json_encode($json));
7 exit();
8 }
9
10 public static function error($n, $msg) {
Huguet57e9f47652018-07-23 03:28:12 +020011 self::funct(["error" => $n, "msg" => $msg]);
avm99963f0d15212017-10-08 17:03:22 +020012 }
13}
14
15if (!isset($_GET["action"])) {
16 write::error(1, "No action provided");
17}
18
19switch ($_GET["action"]) {
20 case "getgraf":
Huguet57b03dfc82018-07-23 01:24:45 +020021 $graf = file_get_contents("https://grafo.dirba.io/api.php?req=getGraph");
avm99963f0d15212017-10-08 17:03:22 +020022 echo $graf;
23 break;
24
25 default:
26 write::error(2, "Unknown action");
27}
28?>