hi!
I write a script for a alerter service. I used php connection_status function to get connection status. Because the script require a inf loop. I look some example and try other scripts but connection_status function always return 0. I think i tried all the script ways. Please help me.
<?php
ignore_user_abort (TRUE);
$x=0;
while ($x++ < 20) {
print $x;
sleep (1);
}
switch (connection_status ()) {
case CONNECTION_NORMAL:
$status = 'Normal';
break;
case CONNECTION_ABORTED:
$status = 'User Abort';
break;
case CONNECTION_TIMEOUT:
$status = 'Max Execution Time exceeded';
break;
case (CONNECTION_ABORTED & CONNECTION_TIMEOUT):
$status = 'Aborted and Timed Out';
break;
default:
$status = 'Unknown';
break;
}
file_put_contents('test.txt',$status);
?>
My system;
php-5.3.1-1 and apache-2.2.14-1