public static function safeEcho($msg) { if (!function_exists('posix_isatty') || posix_isatty(STDOUT)) { echo $msg; } }