public static function safeEcho($msg, $decorated = false)
    {
        $stream = static::outputStream();
        if (!$stream) {
            return false;
        }
        if (!$decorated) {
            $line = $white = $green = $end = '';
            if (static::$_outputDecorated) {
                $line = "\033[1A\n\033[K";
                $white = "\033[47;30m";
                $green = "\033[32;40m";
                $end = "\033[0m";
            }
            $msg = str_replace(array('<n>', '<w>', '<g>'), array($line, $white, $green), $msg);
            $msg = str_replace(array('</n>', '</w>', '</g>'), $end, $msg);
        } elseif (!static::$_outputDecorated) {
            return false;
        }
        fwrite($stream, $msg);
        fflush($stream);
        return true;
    }
public static function safeEcho($msg, $decorated = false)
    {
        $stream = static::outputStream();
        if (!$stream) {
            return false;
        }
        if (!$decorated) {
            $line = $white = $green = $end = '';
            if (static::$_outputDecorated) {
                $line = "\033[1A\n\033[K";
                $white = "\033[47;30m";
                $green = "\033[32;40m";
                $end = "\033[0m";
            }
            $msg = str_replace(array('<n>', '<w>', '<g>'), array($line, $white, $green), $msg);
            $msg = str_replace(array('</n>', '</w>', '</g>'), $end, $msg);
        } elseif (!static::$_outputDecorated) {
            return false;
        }
        fwrite($stream, $msg);
        fflush($stream);
        return true;
    }
public static function safeEcho ( $ msg , $ decorated = false ) { $ stream = static :: outputStream ( ) ; if ( ! $ stream ) { return false ; } if ( ! $ decorated ) { $ line = $ white = $ green = $ end = '' ; if ( static :: $ _outputDecorated ) { $ line = "\033[1A\n\033[K" ; $ white = "\033[47;30m" ; $ green = "\033[32;40m" ; $ end = "\033[0m" ; } $ msg = str_replace ( array ( '<n>' , '<w>' , '<g>' ) , array ( $ line , $ white , $ green ) , $ msg ) ; $ msg = str_replace ( array ( '</n>' , '</w>' , '</g>' ) , $ end , $ msg ) ; } elseif ( ! static :: $ _outputDecorated ) { return false ; } fwrite ( $ stream , $ msg ) ; fflush ( $ stream ) ; return true ; }
Safe Echo.
@param $msg
@param bool $decorated
@return bool
Safe Echo .