|
1 <?php |
|
2 /***************************************************************************** |
|
3 * Copyright (C) 2014 |
|
4 * |
|
5 * Michiel Broek <mbroek at mbse dot eu> |
|
6 * |
|
7 * This file is part of ThermFerm |
|
8 * |
|
9 * This is free software; you can redistribute it and/or modify it |
|
10 * under the terms of the GNU General Public License as published by the |
|
11 * Free Software Foundation; either version 2, or (at your option) any |
|
12 * later version. |
|
13 * |
|
14 * ThermFerm is distributed in the hope that it will be useful, but |
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 * General Public License for more details. |
|
18 * |
|
19 * You should have received a copy of the GNU General Public License |
|
20 * along with ThermFerm; see the file COPYING. If not, write to the Free |
|
21 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
|
22 *****************************************************************************/ |
|
23 |
|
24 require_once('utilities.php'); |
|
25 |
|
26 $what = $_GET['what']; |
|
27 $uuid = $_GET["uuid"]; |
|
28 |
|
29 $sock = open_socket(); |
|
30 if ($sock == false) { |
|
31 echo ""; |
|
32 return; |
|
33 } |
|
34 |
|
35 socket_write($sock, 'GET '.$what.' '.$uuid, 4096); |
|
36 $answer = ""; |
|
37 while (1) { |
|
38 $line = socket_read($sock, 4096); |
|
39 if ($line === '') |
|
40 break; |
|
41 $answer .= $line; |
|
42 } |
|
43 socket_close($sock); |
|
44 |
|
45 $arr = explode(",", $answer); |
|
46 |
|
47 |
|
48 echo $arr[1]; |
|
49 |
|
50 ?> |