Re: PHP output trapping support

From: Date: Sun, 16 May 1999 13:32:37 +0000
Subject: Re: PHP output trapping support
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-5679@lists.php.net to get a copy of this message
Hello Zeev, > > > It's done. PHP 4.0 supports output buffering. Using output buffering, > > > you can easily collect your output into a standard PHP variable, and then > > > feed it to a function or a file or whatever you have in mind. > > > > Brilliant! BTW, could such variable be a variable of an object or is it a > > normal global variable? And is it possible to determine at any time of the > > script execution if the output was already being buffered and into which > > variable? > > Well, I didn't have output mangling in mind when I wrote the output > buffering, but after it was done, it seemed like a crime not to allow some > added value there. I'll show you the API and you can decide for yourself > (all functions begin with ob_, which stands for output buffering): > > ob_start() /* begin buffering output */ > ob_end_flush() /* flush the output buffer, and end output buffering */ > ob_end_clean() /* discard the output buffer, and end output buffering */ > ob_get_contents() /* return the contents of the output buffer */ Well, it seems to be good enough for me. I want it to be able to nest somehow, ie, store the current buffer contents to be allow a different context for buffering and allow the previous context to be restored later. But it seems I can do that already with this API. Anyway, I wonder is there is a way to output messages that are not buffered even if buffering was enabled so I can output things like error messages without changing the current buffer. For instance, will PHP warnings be buffered if buffering is enabled? BTW, do you have a more clear idea of PHP 4/Zend availability dates in alpha, beta, final release phases? Keep up the good work, Manuel Lemos -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5679) next »