We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0f9da9c + efe5b19 commit 4f09ec1Copy full SHA for 4f09ec1
1 file changed
lib/cli/Shell.php
@@ -28,7 +28,7 @@ static public function columns() {
28
static $columns;
29
30
if ( null === $columns ) {
31
- if (stripos(PHP_OS, 'indows') === false) {
+ if ( ! self::is_windows() ) {
32
$columns = (int) exec('/usr/bin/env tput cols');
33
}
34
@@ -71,6 +71,16 @@ static public function isPiped() {
71
static public function hide($hidden = true) {
72
system( 'stty ' . ( $hidden? '-echo' : 'echo' ) );
73
74
+
75
+ /**
76
+ * Is this shell in Windows?
77
+ *
78
+ * @return bool
79
+ */
80
+ static private function is_windows() {
81
+ return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
82
+ }
83
84
85
86
?>
0 commit comments