<?PHP
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
// Package : buffer Version : 1.0
// Date : 01/03/2001 Author : Shaun Thomas
// Req : PHP 3.0 Type : Class
//
// Description:
// ------------
// Every once in a while, a buffer is needed to store information before
// it is presented. Since PHP's buffer system is designed only to control
// *when* things print, and not what the buffer contains, this library
// was written. Just to make things easy, this is a class structure.
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
class CBuffer
{
var $buff; // Our buffer.
// -------------------------------------------------- //
// Starts the buffer by redirecting all output to
// the php output buffer system.
// -------------------------------------------------- //
function start()
{
ob_start();
} // End function start.
// -------------------------------------------------- //
// Updates our buffer to contain the latest and
// greatest.
// -------------------------------------------------- //
function freshen()
{
$this->buff = ob_get_contents();
} // End function freshen.
// -------------------------------------------------- //
// Prints the buffer, emulates a sort of double -
// buffer, since it does not update the current state
// of our buffer variable.
// -------------------------------------------------- //
function dump()
{
print $this->buff;
} // End function dump.
// -------------------------------------------------- //
// Stops and clears the output buffer without doing
// anything else. Keeps us from accidently printing.
// -------------------------------------------------- //
function stop()
{
ob_end_clean();
} // End function stop.
// -------------------------------------------------- //
// Changes the value of the buffer. Basically a
// wrapper for str_replace to shorten syntax.
// -------------------------------------------------- //
function replace($from, $to)
{
$this->buff = str_replace($from,$to,$this->buff);
} // End function replace.
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
// End buffer class
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
?>
|