Buffer
in package
A wrapper for the PHP output buffer.
This naturally flushes the buffer contents when destroyed.
Table of Contents
Properties
- $buffer_level : int
Methods
- __destruct() : mixed
- clean() : string
- Clean and return the contents, including all child buffers.
- close() : string
- Close this buffer (and all child buffers) and return the contents.
- closeAll() : void
- Discard all buffers.
- contents() : string
- Get the contents without clearing it.
- discard() : void
- Discard the buffer contents.
- end() : void
- Close this buffer and all child buffers.
- flush() : void
- Flush this buffer.
- flushAll() : void
- Dump all buffers into the output.
- level() : int
- Get the nested level of this buffer.
- start() : bool
- Open this buffer.
Properties
$buffer_level
private
int
$buffer_level
= 0
Methods
__destruct()
public
__destruct() : mixed
Tags
clean()
Clean and return the contents, including all child buffers.
public
clean() : string
This closes all child buffers.
Return values
stringclose()
Close this buffer (and all child buffers) and return the contents.
public
close() : string
This closes all child buffers.
Return values
stringcloseAll()
Discard all buffers.
public
static closeAll() : void
contents()
Get the contents without clearing it.
public
contents() : string
This closes all child buffers.
Return values
stringdiscard()
Discard the buffer contents.
public
discard() : void
This closes all child buffers.
end()
Close this buffer and all child buffers.
public
end([bool $flush = true ]) : void
Flush or discard contents, including all child buffers.
Parameters
- $flush : bool = true
flush()
Flush this buffer.
public
flush([bool $send = true ]) : void
"Flushing" means to send content to the parent buffer. Content is only sent once there are no more buffers to flush.
This closes all child buffers.
Parameters
- $send : bool = true
-
don't send, just merge child buffers into this one
flushAll()
Dump all buffers into the output.
public
static flushAll() : void
level()
Get the nested level of this buffer.
public
level() : int
Return values
intstart()
Open this buffer.
public
start([null|callable $callback = null ][, int $chunk_size = 0 ][, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS ]) : bool
Parameters
- $callback : null|callable = null
- $chunk_size : int = 0
- $flags : int = PHP_OUTPUT_HANDLER_STDFLAGS
Tags
Return values
bool —true on success, false on failure