Description
Writes the trace line to the fileif we can't open the file turn tracing off This is the sort of message we sometimes get. Not sure what's causing the error. It could be tailing the file.
Warning: fopen(C:\apache\htdocs\wordpress/bwtrace.log): failed to open stream: Permission denied in C:\apache\htdocs\wordpress\wp-content\plugins\oik\bwtrace.inc on line 148 Call Stack:
- {main}() C:\apache\htdocs\wordpress\wp-admin\options-general.php:0
- require_once('C:\apache\htdocs\wordpress\wp-admin\admin.php') C:\apache\htdocs\wordpress\wp-admin\options-general.php:10
- require_once('C:\apache\htdocs\wordpress\wp-load.php') C:\apache\htdocs\wordpress\wp-admin\admin.php:30
- require_once('C:\apache\htdocs\wordpress\wp-config.php') C:\apache\htdocs\wordpress\wp-load.php:29
- require_once('C:\apache\htdocs\wordpress\wp-settings.php') C:\apache\htdocs\wordpress\wp-config.php:117
- include_once('C:\apache\htdocs\wordpress\wp-content\plugins\oik\oik-bwtrace.php') C:\apache\htdocs\wordpress\wp-settings.php:192
- bw_trace_plugin_startup() C:\apache\htdocs\wordpress\wp-content\plugins\oik\oik-bwtrace.php:59
- bw_trace() C:\apache\htdocs\wordpress\wp-content\plugins\oik\oik-bwtrace.php:102
- bw_trace_log() C:\apache\htdocs\wordpress\wp-content\plugins\oik\bwtrace.inc:93
- bw_write() C:\apache\htdocs\wordpress\wp-content\plugins\oik\bwtrace.inc:129
- fopen() C:\apache\htdocs\wordpress\wp-content\plugins\oik\bwtrace.inc:148 ?
Usage
bw_write( $file, $line );Parameters
- $file
- ( mixed ) required –
- $line
- ( mixed ) required –
Returns
voidTO DO
The unwritten logic needs to take into account the file we're trying to write to! Also.. failed to open stream: Resource temporarily unavailableSource
File name: oik-bwtrace/includes/bwtrace.phpLines:
1 to 27 of 27
function bw_write( $file, $line ) { static $unwritten = array(); if ( !$file ) { return( 0 ); } $handle = fopen( $file, "a" ); if ( $handle === FALSE ) { bw_trace_off(); // It would be nice to let them know... $ret = "fopen failed"; if ( isset( $unwritten[ $file ] ) ) { $unwritten[ $file ] .= $line; } else { $unwritten[$file] = $line; } } else { if ( isset( $unwritten[ $file ] ) ) { $bytes = fwrite( $handle, "bw_write unwritten" ); $bytes = fwrite( $handle, $unwritten[ $file ] ); unset( $unwritten[ $file ] ); } $bytes = fwrite( $handle, $line ); $ret = fclose( $handle ); $ret .= " $bytes $file $line"; } return( $ret ); }View on GitHub View on Trac
