blob: 3e5c43eeb422ae092485767301f3d96d2aed1e10 [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 {
5 public static function do($json) {
6 print_r(json_encode($json));
7 exit();
8 }
9
10 public static function error($n, $msg) {
11 self::do(["error" => $n, "msg" => $msg]);
12 }
13}
14
15if (!isset($_GET["action"])) {
16 write::error(1, "No action provided");
17}
18
19switch ($_GET["action"]) {
20 case "getgraf":
21 $graf = file_get_contents("https://dirba.io/grafo/api.php?req=getGraph");
22 echo $graf;
23 break;
24
25 default:
26 write::error(2, "Unknown action");
27}
28?>