Re: PHP 4.0 Bug #8395: register_shutdown_function() error
| From: | Chris Newbill | Date: | Sun, 24 Dec 2000 07:07:45 +0000 |
| Subject: | Re: PHP 4.0 Bug #8395: register_shutdown_function() error | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-42206@lists.php.net to get a copy of this message | ||
4.03pl1 on Redhat 7.0/Apache 1.3.12 works perfectly in about 1 second, I
don't see a third "Hi There!". Although I will note that repeated attempts
to refresh the page constantly does take in some cases 6-7
seconds...commenting out the sleep(10) line eliminates that lag. It's
almost like the sleep() is carrying over to the next request for the page
and you must wait for it to finish???
And being able to send output before the script is done is already available
without having to use a flush(). You can do it in your script by calling
ob_implicit_flush() or turning that option on in your php.ini file.
You can also buffer/flush a specific part of your script like so:
<?php
ob_start();
print "You won't see me till you call ob_end_flush().";
ob_end_flush();
?>
Chris
----- Original Message -----
From: <osp@tinet.org>
To: <php-dev@lists.php.net>
Sent: Saturday, December 23, 2000 9:56 PM
Subject: [PHP-DEV] PHP 4.0 Bug #8395: register_shutdown_function() error
> From: osp@tinet.org
> Operating system: Linux
> PHP version: 4.0.3pl1
> PHP Bug Type: Feature/Change Request
> Bug description: register_shutdown_function() error
>
> <?php
>
> register_shutdown_function("shutdown");
>
> print("Hi There! 1<br>");
> flush();
> sleep(1);
> print("Hi There! 2<br>");
> flush();
> exit();
>
> function shutdown()
> {
> print("Hi There! 3<br>");
> sleep(10);
> }
>
> ?>
>
> - The last "Hi There! 3<br>" shouldn't appear on the client browser, but
it does!
>
> - Response to client browser takes > 10 seconds!
>
> - The script response to the client browser should be sent at the normal
exit point. The shutdown funcion should be quietly executed after the client
browser got his complete response.
>
> - Being able to send response before the script completely ends can be
very useful for speeding up client response times for some applications.
>
> Hope you take these comments in consideration...
> (though I understand maybe there are some limitations on the apache
architecture that prevent this from working- I don't know)
>
>
>
> --
> Edit Bug report at: http://bugs.php.net/?id=8395&edit=1
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>