Gumbo_Buffer



Buffer Class

This class is simply meant to provide an OOP interface for creating a PHP buffer. It starts on construction, and ends when the object is destroyed. The methods will perform basic operations on the buffer.

This class does not perform advanced functionality on output buffers.

To use the buffer, simply create a new instance of the object when the buffer should start. Send any content to the browser, the buffer will catch. Once the buffer is finished, simply destroy the object:

 $buffer = new Gumbo_Buffer ();
 // insert output code
 // ...
 $buffer = null; or unset ($buffer);

Author(s): Michael Luster <mluster79@yahoo.com>
License:New BSD License
Copyright:Copyright (c) 2007, iBayou, Michael Luster
Link:http://sourceforge.net/projects/phpgumbo
Version:0.0.1

Implements interfaces:

Class Methods

public Gumbo_Buffer __construct ( ) [line 60]

Constructor - starts the buffer

  • postcondition:  ob_start ()

[ Top ]
public void __destruct ( ) [line 69]

Destructor - ends the buffer

$buffer = null; or unset ($buffer);

  • postcondition:  ob_end_clean ()

[ Top ]
public void clean ( ) [line 79]

Cleans the output buffer: ob_clean ()

Implementation of:
Gumbo_Interface_Buffer::clean()

[ Top ]
public string contents ( [bool $clean] ) [line 98]

Returns the contents of the buffer: ob_get_contents ()

Parameter(s):

  • (bool) $clean :: cleans the buffer after getting the contents
Implementation of:
Gumbo_Interface_Buffer::contents()

[ Top ]
public void flush ( ) [line 86]

Flushes the contents of the buffer to the browser: ob_flush ()

Implementation of:
Gumbo_Interface_Buffer::flush()

[ Top ]
public int size ( ) [line 120]

Returns the size of the buffer: ob_get_length ()

Implementation of:
Gumbo_Interface_Buffer::size()

[ Top ]