summaryrefslogtreecommitdiff
path: root/getstatus.php.bak
diff options
context:
space:
mode:
Diffstat (limited to 'getstatus.php.bak')
-rwxr-xr-xgetstatus.php.bak30
1 files changed, 30 insertions, 0 deletions
diff --git a/getstatus.php.bak b/getstatus.php.bak
new file mode 100755
index 0000000..368991b
--- /dev/null
+++ b/getstatus.php.bak
@@ -0,0 +1,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);
+
+}
+
+?>