You appear to be a bot. Output may be restricted
Description
Trace anything left in the output buffer(s)We need to test if there is anything in the output buffer before calling ob_get_flush() otherwise it produces a Notice that can get returned to a client. Calling ob_get_status() appears to help in this regard. Note: We don't cater for multiple output buffers.
Artisteer 4.0 saves information in $theme_ob_stack, so we trace that in case it contains Warnings or Fatal messages.
When zlib.output_compression is on then ob_get_status() may return an array like the following. `
Array [name] => (string) "zlib output compression" [type] => (integer) 0 [flags] => (integer) 20512 [level] => (integer) 1 [chunk_size] => (integer) 16384 [buffer_size] => (integer) 20480 [buffer_used] => (integer) 3935 `
In this case should not try to call ob_get_flush() because we get another Notice, due to output handler incompatibilities. As a workaround we first check if zlib.output_compression is set in the php.ini file
Usage
bw_trace_output_buffer();
Parameters
Returns
voidSource
File name: oik-bwtrace/includes/oik-actions.phpLines:
function bw_trace_output_buffer() { if ( ini_get( 'zlib.output_compression') ) { return; } //$ob = ob_get_contents(); $status = ob_get_status(); bw_trace2( $status, "output buffer status", false ); if ( count( $status ) ) { $ob = ob_get_flush(); bw_trace2( $ob, "output buffer", false ); if ( defined( "WP_DEBUG") && WP_DEBUG ) { //echo "output buffer"; //print_r( $ob ); } } global $theme_ob_stack; bw_trace2( $theme_ob_stack, "theme_ob_stack", false ); if ( defined( "WP_DEBUG") && WP_DEBUG ) { //echo "theme_ob_stack"; //print_r( $theme_ob_stack ); } }View on GitHub View on Trac