note 40815 added to function.register-shutdown-function

From: Date: Mon, 15 Mar 2004 19:56:20 +0000
Subject: note 40815 added to function.register-shutdown-function
Groups: php.notes 
Request: Send a blank email to php-notes+get-66880@lists.php.net to get a copy of this message
If you need the old (<4.1) behavior of register_shutdown_function you can achieve the same with "Connection: close" and "Content-Length: xxxx" headers if you know the exact size of the sent data (which can be easily caught with output buffering). An example: <?php header("Connection: close"); ob_start(); phpinfo(); $size=ob_get_length(); header("Content-Length: $size"); ob_end_flush(); flush(); sleep(13); error_log("do something in the background"); ?> The same will work with registered functions. According to http spec, browsers should close the connection when they got the amount of data specified in Content-Length header. At least it works fine for me in IE6 and Opera7. ---- Manual Page -- http://www.php.net/manual/en/function.register-shutdown-function.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40815 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40815&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40815&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66880) next »