|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-03-24 06:29 UTC] wez@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 13:00:01 2025 UTC |
/* 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" */