ID: 22837
Updated by: [EMAIL PROTECTED]
Reported By: gavin at itmerge dot com
-Status: Open
+Status: Wont fix
Bug Type: Filesystem function related
Operating System: Linux Kernel 2.4.18
PHP Version: 4.3.1
New Comment:
This wont be fixed in 4.3.x; you can use stream_select() instead.
PHP5 will have better general support for stream_set_timeout().
Previous Comments:
------------------------------------------------------------------------
[2003-03-24 00:59:51] gavin at itmerge dot com
/* in php 4.3 with the CLI interface
STDIN is predefined */
$auth=0;
stream_set_timeout(STDIN,61);
$time=time();
while ($auth==0 && time()<$time+60) {
while(!feof(STDIN) && $auth==0 && time()<$time+60) {
$test=fgets(STDIN,1024);
}
}
if (time()>=$time+60) echo "You have timedout\n";
/* I never get to the above line
because It sits there at fgets never timing out.
i've tried
set_time_limit(60) and ini_set("max_execution_time",60)
but nothing will stop the script from executing.
i'm running this script thru tcpd
if it gets stuck waiting for input i have to manually kill
all the processes, gets very very icky. :(
btw. i've also tried $stdin=fopen("php://stdin","r");
stream_set_timeout($stdin,61);
ps. i know it's new :), i know it says "potentially"
*/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22837&edit=1