Re: Re: Output Compression & output buffering..

From: Date: Tue, 27 Aug 2002 05:46:29 +0000
Subject: Re: Re: Output Compression & output buffering..
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-114219@lists.php.net to get a copy of this message
Basically the included file containing the error handler is like so -> ------------- <?php error_reporting( E_ALL ); set_error_handler('errorhandler'); ob_start(); function display_error() { ob_end_clean(); // display error page here } function errorhandler() {
    // cycle through errors here and execute display_error() when needed.
} ?> -------------- In another file, I start compression like -> if ($compress == '1') { ob_start('gz_handler'); } ------------- Then at the end of the script I have ob_end_flush(); I believe the sequence of events are correct. I just so happened to pass by zend.com, and in the newsletter #100 from the 26th, there is a blurb about ob_gzhandler being broken. Im running php 4.2.2, so it may apply to me, as Im getting the blank page that its describing. Thanks for your help. Eric Pignot wrote:
Hi Gerard, I never had any problem using output buffering... Do you correctly dump the buffer when an error occurs ? I suppose you have built your own error() function, a bit like this one : exit_on_error($msg){ ob_end_clean(); echo $msg; exit(); } can you tell us a bit more concerning the way you handle the exit of your program ? regards Eric "Gerard Samuel" <gsam@trini0.org> a écrit dans le message de news: 3D6AB911.6010001@trini0.org...
In an included file, I have an error handler that is using the 'output buffering' trick to dump a page in progress to display the error page. I also happened to have a switch to turn on output compression. When output compression is on, if an error is comitted while the page is displaying, I get an empty page, instead of the expected error page or the page hangs, depending on the browser. Has anyone gotten both forms of output control to work together without ill side effects?? Thanks -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/

« previous php.general (#114219) next »