Usage

Parameters

Returns

TO DO

The unwritten logic needs to take into account the file we're trying to write to! Also.. failed to open stream: Resource temporarily unavailable

Source

File name: oik-bwtrace/includes/bwtrace.phpLines:

1 to 27 of 27

functionbw_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);}