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