| OLD | NEW |
| 1 <?php | 1 <?php |
| 2 require_once '../../resources/portabilityLayer.php'; | 2 require_once '../../resources/portabilityLayer.php'; |
| 3 | 3 |
| 4 $beaconFilename = sys_get_temp_dir() . "/beacon" . (isset($_REQUEST['name']) ? $
_REQUEST['name'] : "") . ".txt"; | 4 $beaconFilename = sys_get_temp_dir() . "/beacon" . (isset($_REQUEST['name']) ? $
_REQUEST['name'] : "") . ".txt"; |
| 5 | 5 |
| 6 $max_attempts = 700; | 6 $max_attempts = 700; |
| 7 $retries = isset($_REQUEST['retries']) ? (int)$_REQUEST['retries'] : $max_attemp
ts; | 7 $retries = isset($_REQUEST['retries']) ? (int)$_REQUEST['retries'] : $max_attemp
ts; |
| 8 while (!file_exists($beaconFilename) && $retries != 0) { | 8 while (!file_exists($beaconFilename) && $retries != 0) { |
| 9 usleep(10000); | 9 usleep(10000); |
| 10 # file_exists() caches results, we want to invalidate the cache. | 10 # file_exists() caches results, we want to invalidate the cache. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 fclose($beaconFile); | 29 fclose($beaconFile); |
| 30 unlink($beaconFilename); | 30 unlink($beaconFilename); |
| 31 } else { | 31 } else { |
| 32 echo "Beacon status not readable\n"; | 32 echo "Beacon status not readable\n"; |
| 33 } | 33 } |
| 34 } else { | 34 } else { |
| 35 echo "Beacon not sent\n"; | 35 echo "Beacon not sent\n"; |
| 36 } | 36 } |
| 37 ?> | 37 ?> |
| OLD | NEW |