My goal is to parse apache log into a php piped program.

I need pcntl_alarm to launch some function, while reading stdin.

When exiting of pcntl_alarm function handler, i loose STDIN,
php say it's a valid resource, but feof found, since data continu
to be send into the pipe.

With php5-rc1 it was working, using fopen("php://stdin","r");
With php5-rc2,rc3,0.0.0, it doesn't work, using STDIN

I think it's a bug but i'm not sure, please correct me if a make
a nonsense.

- You will find php sample code at http://exeprod.com/test_cli_signal.txt

- To use it you just make something like that :
 while :; do date; sleep 1; done | /usr/local/bin/php test_cli_signal.php

- It will give you output like :
sam jui 17 01:29:48 CEST 2004
sam jui 17 01:29:49 CEST 2004
sam jui 17 01:29:50 CEST 2004
je passe dans sig_handler (14)               <-- sig_handler() function
Already reading from stdin                    <-- read_stdin() function
exiting read_stdin()
STDIN: Resource id #1
is_resource(STDIN)=1



Any help will be very appreciated.
Critical for me

Thanks in advanced.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to