Re: [PHP] How to detect a PHP script time-out?

2003-01-09 Thread Tamas Arpad
Cool! I just tested it out and it works. At lest under PHP 4.3.0 and Apache 1.3.26. But according to the bug report this functionality may change in the future and a new function apache_register_shutdown() might replace the current one ... The current functionality is *not* what is

Re: [PHP] How to detect a PHP script time-out?

2003-01-09 Thread Jean-Christian Imbeault
Tamas Arpad wrote: There was a discussion about this topic on the dev list, and because of many reasons the current functionality of register_shutdown_function() will remain the same in future releases too. Joseph Tate is working on a new function (apache_register_shutdown_function) to make

Re: [PHP] How to detect a PHP script time-out?

2003-01-08 Thread Robert Fisher
If you are willing to do a rewrite, then have your main script start a fork, or child process. The child process would run your script while the parent would do nothing else but wait for the child. if the child times out the parent will know and you can then print out a error message. See the

Re: [PHP] How to detect a PHP script time-out?

2003-01-08 Thread Tamas Arpad
On Wednesday 08 January 2003 06:42, Jean-Christian Imbeault wrote: Timothy Hitchens ) wrote: Issue... as I said before the register shutdown won't work because: - output from the shutdown is not visible nor do you have access to some variables You are right. From the manual:

Re: [PHP] How to detect a PHP script time-out?

2003-01-08 Thread Jean-Christian Imbeault
Tamas Arpad wrote: That's not right now. The manual is outdated. See this bug report http://bugs.php.net/bug.php?id=15209. This behavior was changed from 4.06 to 4.1. In newer versions of php the registered functions will run before the connection is closed so ouptput can be done from there

[PHP] How to detect a PHP script time-out?

2003-01-07 Thread Jean-Christian Imbeault
How can I detect if my PHP script is about to time-out? I would like to be able to detect a time-out and display a page with an appropriate error message i.e. the server is busy now, please try again later. Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Timothy Hitchens \(HiTCHO\)
] -Original Message- From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 1:25 PM To: [EMAIL PROTECTED] Subject: [PHP] How to detect a PHP script time-out? How can I detect if my PHP script is about to time-out? I would like to be able to detect a time

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Jean-Christian Imbeault
Timothy Hitchens ) wrote: Set up output buffering on your page then if the page times out the buffer should be sent to the browser and that is loaded with your message. Ok. Is there another solution? The reason I ask is that in order to use your solution I would need to redesign my pages

RE: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Timothy Hitchens \(HiTCHO\)
[mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 1:43 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to detect a PHP script time-out? Timothy Hitchens ) wrote: Set up output buffering on your page then if the page times out the buffer should be sent to the browser

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Greg Beaver
Hi Jean-Christian, see: http://www.php.net/manual/en/features.connection-handling.php Take care, Greg -- phpDocumentor http://www.phpdoc.org Jean-Christian Imbeault [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Timothy Hitchens ) wrote: Set up output

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Jean-Christian Imbeault
Greg Beaver wrote: http://www.php.net/manual/en/features.connection-handling.php Nice! So if I understand correctly I need to: 1- register a shutdown function 2- have this function check if it was called b/c of a conection_timeout() 3- And if so have the function print out my timeout error

RE: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Timothy Hitchens \(HiTCHO\)
] -Original Message- From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 3:29 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to detect a PHP script time-out? Greg Beaver wrote: http://www.php.net/manual/en/features.connection-handling.php Nice

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Greg Beaver
You can try that code. It looks like connection_timeout() is deprecated, however. You should probably use connection_aborted() and connection_status() http://www.php.net/manual/en/function.connection-status.php http://www.php.net/manual/en/function.connection-aborted.php Read the user notes in

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Jean-Christian Imbeault
Timothy Hitchens ) wrote: Issue... as I said before the register shutdown won't work because: - output from the shutdown is not visible nor do you have access to some variables You are right. From the manual: http://www.php.net/manual/en/function.register-shutdown-function.php The

RE: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Timothy Hitchens \(HiTCHO\)
[mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 3:43 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to detect a PHP script time-out? Timothy Hitchens ) wrote: Issue... as I said before the register shutdown won't work because: - output from the shutdown is not visible nor

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Jean-Christian Imbeault
Timothy Hitchens ) wrote: There is one last option ... register an output buffer as I suggested before suggested but this time do the reverse and you don't have to rewrite your scripts: Ok I think I understand what you are proposing. I just have one question about your example code. Where

RE: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Timothy Hitchens \(HiTCHO\)
PROTECTED] Subject: Re: [PHP] How to detect a PHP script time-out? Timothy Hitchens ) wrote: There is one last option ... register an output buffer as I suggested before suggested but this time do the reverse and you don't have to rewrite your scripts: Ok I think I understand what

Re: [PHP] How to detect a PHP script time-out?

2003-01-07 Thread Jean-Christian Imbeault
Timothy Hitchens ) wrote: No you can't.. the issue with this is that you need to have error reporting turned on.. so you will need to have more error collecting or removing. [..] This isn't the best for a production env but this is the best I can see considering you don't want to rewrite!!