Exemplo n.º 1
0
 public static function hasFormattingCodes()
 {
     if (self::$formattingCodes === null) {
         $opts = getopt("", ["enable-ansi", "disable-ansi"]);
         //if(isset($opts["disable-ansi"])){
         //	self::$formattingCodes = false;
         //}else{
         self::$formattingCodes = (Utils::getOS() !== "win" and getenv("TERM") != "" and (!function_exists("posix_ttyname") or !defined("STDOUT") or posix_ttyname(STDOUT) !== false) or isset($opts["enable-ansi"]));
         //}
     }
     return self::$formattingCodes;
 }
Exemplo n.º 2
0
 public static function hasFormattingCodes()
 {
     if (self::$formattingCodes === \null) {
         $opts = \getopt("", ["enable-ansi", "disable-ansi"]);
         if (isset($opts["disable-ansi"])) {
             self::$formattingCodes = \false;
         } else {
             self::$formattingCodes = (Utils::getOS() !== "win" and \getenv("TERM") !== "" or isset($opts["enable-ansi"]));
         }
     }
     return self::$formattingCodes;
 }