OLD | NEW |
1 <?php | 1 <?php |
2 while (!file_exists("ping.txt")) { | 2 require_once '../../resources/portabilityLayer.php'; |
| 3 |
| 4 $pingFilename = sys_get_temp_dir() . "/ping.txt"; |
| 5 while (!file_exists($pingFilename)) { |
3 usleep(10000); | 6 usleep(10000); |
4 // file_exists() caches results, we want to invalidate the cache. | 7 // file_exists() caches results, we want to invalidate the cache. |
5 clearstatcache(); | 8 clearstatcache(); |
6 } | 9 } |
7 | 10 |
8 echo "<html><body>\n"; | 11 echo "<html><body>\n"; |
9 echo "Ping sent successfully"; | 12 $pingFile = fopen($pingFilename, 'r'); |
10 $pingFile = fopen("ping.txt", 'r'); | 13 if ($pingFile) { |
11 while ($line = fgets($pingFile)) { | 14 echo "Ping sent successfully"; |
12 echo "<br>"; | 15 while ($line = fgets($pingFile)) { |
13 echo trim($line); | 16 echo "<br>"; |
| 17 echo trim($line); |
| 18 } |
| 19 fclose($pingFile); |
| 20 unlink($pingFilename); |
| 21 } else { |
| 22 echo "Ping not sent"; |
14 } | 23 } |
15 fclose($pingFile); | |
16 unlink("ping.txt"); | |
17 echo "<script>"; | 24 echo "<script>"; |
18 echo "if (window.testRunner)"; | 25 echo "if (window.testRunner)"; |
19 echo " testRunner.notifyDone();"; | 26 echo " testRunner.notifyDone();"; |
20 echo "</script>"; | 27 echo "</script>"; |
21 echo "</body></html>"; | 28 echo "</body></html>"; |
22 ?> | 29 ?> |
OLD | NEW |