#20447 [Opn]: Register_shutdown_function - connection still open while registered shutdown...

From: Date: Sun, 04 May 2003 07:31:27 +0000
Subject: #20447 [Opn]: Register_shutdown_function - connection still open while registered shutdown...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39011@lists.php.net to get a copy of this message
 ID:               20447
 Updated by:       spic@php.net
 Reported By:      richardz at omniture dot com
 Status:           Open
-Bug Type:         Documentation problem
+Bug Type:         Unknown/Other Function
 Operating System: RedHat 7.2
 PHP Version:      4.2.3
 New Comment:

Is this a documentation problem or a php-bug?

According to some users the documented behaviour worked under PHP <
4.1.0, but now the function behaves differently.

Could someone please check this?


Previous Comments:
------------------------------------------------------------------------

[2003-01-16 12:14:43] firewire at itsyourdomain dot com

I to have run across this problem. I was hoping to use a registered
shutdown function to do some final fairly slow socket processing that
the client didn't need to see. My test case is as follows:

register_shutdown_function('sd');

function sd()
{
  echo "I shouldn't be seen";
  sleep(5);
}

Causes the browser to echo text then sleep for 5 seconds before
completing the page. I also agree that the manual is incorrect. Is
there another way to force php to close the output stream so slower non
user related functions can be executed?

------------------------------------------------------------------------

[2002-11-15 10:32:35] richardz at omniture dot com

My problem is that the connection to the browser is still open while
the registered shutdown functions are executing.  The documentation
says that from the registered shutdown functions you WON'T be able to
echo or print or modify the contents of the buffer. I can...

Example:
using apache 1.3.27
php version 4.2.3
//////////////////////////////////////////////
<?
function doThing(){
     for($i=0;$i<100000;$i++){
          //just looping to demonstrate that the page hangs while
executing this function
     }
     echo "PHP documentation says I shouldn't see this in my browser";
}
register_shutdown_function('doThing');

?>
<html>
Test Page.
<br><br>
</html>
////////////////////////////////////////////


I was hoping to register shutdown functions to do some cleanup -
without affecting the load time of the site.  Apparently these
functions don't work that way?

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20447&edit=1



Thread (1 message)

  • spic@php.net
  • Unknown Message
    • spic@php.net
« previous php.bugs (#39011) next »