summaryrefslogtreecommitdiff
path: root/getstatus.php.bak
blob: 368991b1de290aab6591447ff672552706bec582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
header('Content-type: application/json');
$oldtree = null;
$time = time();
$i = 0;
while((time() - $time) < 29)
{
      $tree = file_get_contents("status.txt");

      if ($tree !== $oldtree  )
      {
        $i+=1;
        print $tree;
        ob_flush();
        flush();
      }
     $data = json_decode($tree);
     if ($data->status == "ready")
        {
        break;
        } else if ($data->status == "error")
        {
        break;
        }
     $oldtree = $tree;
     usleep(1000);

}

?>