Re: [PHP-DEV] Timeout Function

2001-04-25 Thread Wico de Leeuw
At 13:53 24-4-2001 -0700, Rasmus Lerdorf wrote: > > I would like to see a timeout function implemented in PHP (something like > > Perl's alarm function would be perfect). I notice there is a > > set_time_limit() function in PHP, but it cannot be applied to a specified > > block of code (it applies

Re: [PHP-DEV] Timeout Function:

2001-04-24 Thread Zeev Suraski
Perl uses SIGALRM to implement alarms, something which is not an option when you're an Apache module. Zeev At 02:13 25/4/2001, Jason Sims wrote: > > Personally, I think having an alarm (timeout) function is a really good > > idea. > > > > Setting a timer, and then being able to jump from whatev

Re: [PHP-DEV] Timeout Function:

2001-04-24 Thread Stig Sæther Bakken
[Jason Sims <[EMAIL PROTECTED]>] > > Personally, I think having an alarm (timeout) function is a really good > > idea. > > > > Setting a timer, and then being able to jump from whatever you are doing if > > it is taking too long is something that has helped me do some really neat > > stuff in C a

Re: [PHP-DEV] Timeout Function:

2001-04-24 Thread Rasmus Lerdorf
> Although I've been able to solve my current problem with fsockopen(), I > think an alarm function would be nice to have for other things. Perl is > open-source, right? Probably the best way to implement this in PHP would be > to look at how Perl is doing it and go from there. I don't disagree t

Re: [PHP-DEV] Timeout Function:

2001-04-24 Thread Jason Sims
> Personally, I think having an alarm (timeout) function is a really good > idea. > > Setting a timer, and then being able to jump from whatever you are doing if > it is taking too long is something that has helped me do some really neat > stuff in C and Perl... and I was a little dissapointed wh

[PHP-DEV] Timeout Function:

2001-04-24 Thread Brian Tanner
Personally, I think having an alarm (timeout) function is a really good idea. Setting a timer, and then being able to jump from whatever you are doing if it is taking too long is something that has helped me do some really neat stuff in C and Perl... and I was a little dissapointed when I learned

Re: [PHP-DEV] Timeout Function

2001-04-24 Thread Rasmus Lerdorf
> > Right, but when you are doing network work like this you should be using > > fsockopen() directly which does have timeout support. readfile() with a > > url argument just does a simple fsockopen anyway and issues a GET request. > > Trivial to do yourself using fsockopen() and fputs() and this

Re: [PHP-DEV] Timeout Function

2001-04-24 Thread Jason Sims
> Right, but when you are doing network work like this you should be using > fsockopen() directly which does have timeout support. readfile() with a > url argument just does a simple fsockopen anyway and issues a GET request. > Trivial to do yourself using fsockopen() and fputs() and this way you

Re: [PHP-DEV] Timeout Function

2001-04-24 Thread Rasmus Lerdorf
> > That's not true. If you use register_shutdown_function() then this > > function you register will be run once the timeout hits. See the chapter > > in the manual on connection handling. > > But this still doesn't let you apply a timeout to a specific block of code. > I am doing ad calls to a

Re: [PHP-DEV] Timeout Function

2001-04-24 Thread Jason Sims
> That's not true. If you use register_shutdown_function() then this > function you register will be run once the timeout hits. See the chapter > in the manual on connection handling. But this still doesn't let you apply a timeout to a specific block of code. I am doing ad calls to a remote ser

Re: [PHP-DEV] Timeout Function

2001-04-24 Thread Rasmus Lerdorf
> I would like to see a timeout function implemented in PHP (something like > Perl's alarm function would be perfect). I notice there is a > set_time_limit() function in PHP, but it cannot be applied to a specified > block of code (it applies to the entire script) and it causes a fatal error > whe

[PHP-DEV] Timeout Function

2001-04-24 Thread Jason Sims
I would like to see a timeout function implemented in PHP (something like Perl's alarm function would be perfect). I notice there is a set_time_limit() function in PHP, but it cannot be applied to a specified block of code (it applies to the entire script) and it causes a fatal error when the time