Re: [PHP4BETA] Output Buffering

[email protected] (Zeev Suraski) Tue, 6 Jun 2000 22:23:33 +0300 (IDT)
Newsgroups php.version4
Message-ID <[email protected]>
It is a set of functions, even though if you just want to enable output
buffering completely, you can use the INI directive.  The set of functions
gives you much more configurability and functionality, and enables you to
do quite a few interesting things, mainly with the ob_get_contents()
function:

/* {{{ proto void ob_start(void)
   Turn on Output Buffering */

/* {{{ proto void ob_end_flush(void)
   Flush (send) the output buffer, and turn off output buffering */

/* {{{ proto void ob_end_clean(void)
   Clean (erase) the output buffer, and turn off output buffering */

/* {{{ proto string ob_get_contents(void)
   Return the contents of the output buffer */


This isn't really related to the rest of the output buffering functions,
but actually has an opposite effect - it makes output even less buffered
than it is by default.  PHP uses the Web server buffering by default,
regardless of whether you turn on the new output buffering feature.  This
means that when you send output to the browser, it doesn't actually gets
sent, but rather, is buffered in the Web server buffers.  Sometimes
(mainly in applications that run for a long time and report status via a
web page), you'd want to disable this buffering.  The following function
gives you a way of doing this (it doesn't actually turn off this buffering
since it's not possible, but for all practical purposes, it has the same
effect):

/* {{{ proto void ob_implicit_flush([int flag])
   Turn implicit flush on/off and is equivalent to calling flush() after
every output call */




On Tue, 6 Jun 2000, Mitch Vincent wrote:

> I see now it's not of a setting than a function (though I saw the
> functionality described as a "Set of functions")..
> 
> So I guess -- nevermind!
> 
> Thanks!
> 
> - Mitch
> 
> "The only real failure is quitting."
> 
> 
> 
> 
> 

-- 
Zeev Suraski <[email protected]>
http://www.zend.com/