C# Class Pchp.Library.Output

PHP output control functions implementation.
Mostrar archivo Open project: iolevel/peachpie

Public Methods

Method Description
flush ( Context ctx ) : void

Flush the output buffer of the HTTP server. Has no effect on data buffered in output buffers. No value is returned.

ob_clean ( Context ctx ) : void

Discards the contents of the current level of buffering. No value is returned.

ob_end_clean ( Context ctx ) : bool

Discards the contents of the current level of buffering and decreases the level.

ob_end_flush ( Context ctx ) : bool

Flushes the contents of the current level of buffering and decreases the level.

ob_flush ( Context ctx ) : void

Flushes data from the current level of buffering to the previous one or to the client if the current one is the first one. Applies the filter assigned to the current level (if any). No value is returned.

ob_get_clean ( Context ctx ) : PhpValue

Gets the contents of the current buffer and cleans it.

ob_get_contents ( Context ctx ) : PhpValue

Gets the content of the current buffer.

ob_get_flush ( Context ctx ) : PhpValue

Gets the content of the current buffer and decreases the level of buffering.

ob_get_length ( Context ctx ) : PhpValue

Retrieves the length of the output buffer.

ob_get_level ( Context ctx ) : int

Retrieves the level of buffering.

ob_get_status ( Context ctx ) : PhpArray

Get the status of the current or all output buffers.

ob_get_status ( Context ctx, bool full ) : PhpArray

Get the status of the current or all output buffers.

ob_gzhandler ( Context ctx, PhpValue data, int mode ) : PhpValue

Compresses data by gzip compression.

The function does not support subsequent calls to compress more chunks of data subsequentally.

ob_implicit_flush ( Context ctx ) : void

Switches implicit flushing on. No value is returned.

Affects the current script context.

ob_implicit_flush ( Context ctx, bool doFlush ) : void

Switches implicit flushing on or off. No value is returned.

Affects the current script context. There is a bug in the PHP implementation of this function: "Turning implicit flushing on will disable output buffering, the output buffers current output will be sent as if ob_end_flush() had been called." Actually, this is not true (PHP doesn't do that) and in fact it is nonsense because ob_end_flush only flushes and destroys one level of buffering. It would be more meaningful if ob_implicit_flush function had flushed and destroyed all existing buffers and so disabled output buffering.

ob_list_handlers ( Context ctx ) : PhpArray
ob_start ( Context ctx, Delegate filter = null, int chunkSize, bool erase = true ) : bool

Increases the level of buffering, enables output buffering if disabled and assignes the filtering callback to the new level of buffering.

printf ( Context ctx, string format ) : int

Generates output according to the specified formatting string.

vprintf ( Context ctx, string format, PhpArray args ) : int

Generates output according to the specified formatting string.

Private Methods

Method Description
EndInternal ( Context ctx, bool flush ) : bool

Decreases the level of buffering and discards or flushes data on the current level of buffering.

GetLevelStatus ( BufferedOutput bo, int index ) : PhpArray

Method Details

flush() public static method

Flush the output buffer of the HTTP server. Has no effect on data buffered in output buffers. No value is returned.
public static flush ( Context ctx ) : void
ctx Pchp.Core.Context
return void

ob_clean() public static method

Discards the contents of the current level of buffering. No value is returned.
public static ob_clean ( Context ctx ) : void
ctx Pchp.Core.Context
return void

ob_end_clean() public static method

Discards the contents of the current level of buffering and decreases the level.
public static ob_end_clean ( Context ctx ) : bool
ctx Pchp.Core.Context
return bool

ob_end_flush() public static method

Flushes the contents of the current level of buffering and decreases the level.
public static ob_end_flush ( Context ctx ) : bool
ctx Pchp.Core.Context
return bool

ob_flush() public static method

Flushes data from the current level of buffering to the previous one or to the client if the current one is the first one. Applies the filter assigned to the current level (if any). No value is returned.
public static ob_flush ( Context ctx ) : void
ctx Pchp.Core.Context
return void

ob_get_clean() public static method

Gets the contents of the current buffer and cleans it.
public static ob_get_clean ( Context ctx ) : PhpValue
ctx Pchp.Core.Context
return Pchp.Core.PhpValue

ob_get_contents() public static method

Gets the content of the current buffer.
public static ob_get_contents ( Context ctx ) : PhpValue
ctx Pchp.Core.Context
return Pchp.Core.PhpValue

ob_get_flush() public static method

Gets the content of the current buffer and decreases the level of buffering.
public static ob_get_flush ( Context ctx ) : PhpValue
ctx Pchp.Core.Context
return Pchp.Core.PhpValue

ob_get_length() public static method

Retrieves the length of the output buffer.
public static ob_get_length ( Context ctx ) : PhpValue
ctx Pchp.Core.Context
return Pchp.Core.PhpValue

ob_get_level() public static method

Retrieves the level of buffering.
public static ob_get_level ( Context ctx ) : int
ctx Pchp.Core.Context
return int

ob_get_status() public static method

Get the status of the current or all output buffers.
public static ob_get_status ( Context ctx ) : PhpArray
ctx Pchp.Core.Context
return Pchp.Core.PhpArray

ob_get_status() public static method

Get the status of the current or all output buffers.
public static ob_get_status ( Context ctx, bool full ) : PhpArray
ctx Pchp.Core.Context Current runtime context.
full bool Whether to retrieve extended information about all levels of buffering or about the current one.
return Pchp.Core.PhpArray

ob_gzhandler() public static method

Compresses data by gzip compression.
The function does not support subsequent calls to compress more chunks of data subsequentally.
public static ob_gzhandler ( Context ctx, PhpValue data, int mode ) : PhpValue
ctx Pchp.Core.Context Current runtime context.
data Pchp.Core.PhpValue Data to be compressed.
mode int Compression mode.
return Pchp.Core.PhpValue

ob_implicit_flush() public static method

Switches implicit flushing on. No value is returned.
Affects the current script context.
public static ob_implicit_flush ( Context ctx ) : void
ctx Pchp.Core.Context
return void

ob_implicit_flush() public static method

Switches implicit flushing on or off. No value is returned.
Affects the current script context. There is a bug in the PHP implementation of this function: "Turning implicit flushing on will disable output buffering, the output buffers current output will be sent as if ob_end_flush() had been called." Actually, this is not true (PHP doesn't do that) and in fact it is nonsense because ob_end_flush only flushes and destroys one level of buffering. It would be more meaningful if ob_implicit_flush function had flushed and destroyed all existing buffers and so disabled output buffering.
public static ob_implicit_flush ( Context ctx, bool doFlush ) : void
ctx Pchp.Core.Context Current runtime context.
doFlush bool Do flush implicitly?
return void

ob_list_handlers() public static method

public static ob_list_handlers ( Context ctx ) : PhpArray
ctx Pchp.Core.Context
return Pchp.Core.PhpArray

ob_start() public static method

Increases the level of buffering, enables output buffering if disabled and assignes the filtering callback to the new level of buffering.
public static ob_start ( Context ctx, Delegate filter = null, int chunkSize, bool erase = true ) : bool
ctx Pchp.Core.Context Current runtime context.
filter System.Delegate The filtering callback. Ignores invalid callbacks.
chunkSize int Not supported.
erase bool Not supported.
return bool

printf() public static method

Generates output according to the specified formatting string.
public static printf ( Context ctx, string format ) : int
ctx Pchp.Core.Context Current runtime context.
format string The formatting string. See also the sprintf function ().
return int

vprintf() public static method

Generates output according to the specified formatting string.
public static vprintf ( Context ctx, string format, PhpArray args ) : int
ctx Pchp.Core.Context Current runtime context.
format string The formatting string.
args Pchp.Core.PhpArray Array of variables to format.
return int