}
if ( $channel === null ) {
$this->cleanupChanneled();
- if( php_sapi_name() == 'cli' ) {
- fwrite( STDOUT, $out );
- } else {
- print( $out );
- }
+ print( $out );
} else {
$out = preg_replace( '/\n\z/', '', $out );
$this->outputChanneled( $out, $channel );
*/
public function cleanupChanneled() {
if ( !$this->atLineStart ) {
- if( php_sapi_name() == 'cli' ) {
- fwrite( STDOUT, "\n" );
- } else {
- print "\n";
- }
+ print "\n";
$this->atLineStart = true;
}
}
return;
}
- $cli = php_sapi_name() == 'cli';
-
// End the current line if necessary
if ( !$this->atLineStart && $channel !== $this->lastChannel ) {
- if( $cli ) {
- fwrite( STDOUT, "\n" );
- } else {
- print "\n";
- }
+ print "\n";
}
- if( $cli ) {
- fwrite( STDOUT, $msg );
- } else {
- print $msg;
- }
+ print $msg;
$this->atLineStart = false;
if ( $channel === null ) {
// For unchanneled messages, output trailing newline immediately
- if( $cli ) {
- fwrite( STDOUT, "\n" );
- } else {
- print "\n";
- }
+ print "\n";
$this->atLineStart = true;
}
$this->lastChannel = $channel;