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