Flourish PHP Unframework

fBuffer

static class, v1.0.0b3

Provides a single, simplified interface for output buffering to prevent nested buffering issues and provide a more logical API

Changes:
1.0.0b3Added a check to ensure the zlib extension is installd when doing gzipped buffering 5/20/10
1.0.0b2Added the $gzip parameter to start() 5/19/10
1.0.0bThe initial implementation 3/16/08

Static Methods

::erase() public

Erases the output buffer

Signature

void erase( )

::get() public

Returns the contents of output buffer

Signature

string get( )

Returns

The contents of the output buffer

::isStarted() public

Checks if buffering has been started

Signature

boolean isStarted( )

Returns

If buffering has been started

::replace() public

Replaces a value in the output buffer

Signature

void replace( string $find, string $replace )

Parameters

string $find The string to find
string $replace The string to replace

::reset() internal public

Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code

Resets the configuration and buffer of the class

Signature

void reset( )

::start() public

Starts output buffering

Signature

void start( boolean $gzip=FALSE )

Parameters

boolean $gzip If the buffered output should be gzipped using ob_gzhandler()

::startCapture() public

Starts capturing output, should be used with stopCapture() to grab output from code that does not offer an option of returning a value instead of outputting it

Signature

void startCapture( )

::stop() public

Stops output buffering, flushing everything to the browser

Signature

void stop( )

::stopCapture() public

Stops capturing output, returning what was captured

Signature

string stopCapture( )

Returns

The captured output