ANSIコンソールを使用する

画像 コンソール用のプログラムを作成する必要がある頻度は? それほど頻繁ではありませんか? しかし、最近、私はちょうどそれを最近行ってきました...したがって、私はクラスを作りました(実際、私は非常に長い時間前にそれをしました)。
このクラスを使用すると、テキストの強調表示、文字またはテキストの背景の強調表示、カーソルを目的の位置に設定、出力用のコンソールの選択、コンソールへのテキスト入力などの簡単な操作を実行できます。

長い間舌を振りません。 カットの下に行った誰もが明らかに彼が来た理由を知っています。 したがって、...コードは次のとおりです。
<?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  1. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  2. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  3. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  4. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  5. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  6. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  7. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  8. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  9. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  10. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  11. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  12. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  13. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  14. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  15. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  16. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  17. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  18. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  19. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  20. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  21. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  22. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  23. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  24. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  25. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  26. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  27. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  28. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  29. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  30. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  31. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  32. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  33. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  34. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  35. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  36. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  37. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  38. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  39. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  40. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  41. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  42. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  43. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  44. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  45. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  46. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  47. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  48. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  49. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  50. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  51. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  52. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  53. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  54. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  55. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  56. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  57. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  58. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  59. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  60. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  61. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  62. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  63. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  64. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  65. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  66. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  67. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  68. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  69. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  70. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  71. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  72. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  73. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  74. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  75. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  76. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  77. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  78. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  79. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  80. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  81. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  82. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  83. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  84. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  85. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  86. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  87. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  88. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  89. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  90. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  91. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  92. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
  93. <?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
<?php class console { const TARGET_OUTPUT = "php://output" ; const TARGET_STDOUT = "php://stdout" ; const TARGET_STDERR = "php://stderr" ; const TARGET_STDIN = "php://stdin" ; protected static $color = array( 'gray' => 30, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'default' => 39 ); protected static $bgcolor = array( 'gray' => 40, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47, 'default' => 49, ); protected static $style = array( 'default' => '0' , 'bold' => 1, 'faint' => 2, 'normal' => 22, 'italic' => 3, 'notitalic' => 23, 'underlined' => 4, 'doubleunderlined' => 21, 'notunderlined' => 24, 'blink' => 5, 'blinkfast' => 6, 'noblink' => 25, 'negative' => 7, 'positive' => 27, ); private $text = "" ; // Outputing public function draw($text= '' ) { echo $ this ->text.$text; $ this ->text = '' ; return $ this ; } // Input public function readNumeric() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%d\n" , $number); return $number; } public function readString() { $stdin = fopen( 'php://stdin' , 'r' ); $line = trim(fgets($stdin)); fscanf($stdin, "%s\n" , $ string ); return $ string ; } // Sound public function beep() { echo "\007" ; return $ this ; } public function setSoundHerz($herz=100) { echo "\033[10;{$herz}]" ; return $ this ; } public function setSoundLong($milliseconds=500) { echo "'033[11;{$milliseconds}]" ; return $ this ; } // Cursor position public function toPos( $row = 1, $column = 1 ) { echo "\033[{$row};{$column}H" ; return $ this ; } public function cursorUp($lines=1) { echo "\033[{$lines}A" ; return $ this ; } public function cursorDown($lines=1) { echo "\033[{$lines}B" ; return $ this ; } public function cursorRight($columns=1) { echo "\033[{$columns}C" ; return $ this ; } public function cursorLeft($columns=1) { echo "\033[{$columns}D" ; return $ this ; } // Text colors public function setStyle($style= 'default' ) { $ this ->text .= "\033[" .$ this ->style[$style]. "m" ; return $ this ; } public function setColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->color[$style]; return $ this ; } public function setBgColor($color= 'default' ) { $ this ->text .= "\033[" .$ this ->bgcolor[$style]; return $ this ; } // Application public function setAppName($name= '' ) { echo "\033]0;{$name}\007" ; return $ this ; } public function setTitle($name= '' ) { echo "\033]2;{$name}\007" ; return $ this ; } public function setIcon($name= '' ) { echo "\033]1;{$name}\007" ; return $ this ; } // Other public function clear() { echo "\033c" ; return $ this ; } public function console($num=1) { echo "\033[12;{$num}]" ; return $ this ; } } ?> * This source code was highlighted with Source Code Highlighter .
次のリンクのphpclasses.orgからダウンロードすることもできます: http ://www.phpclasses.org/browse/package/4969.html
そして、私のブログのクロスポストを参照してくださいhttp : //alexsnet.ru/2008/11/how-to-work-with-ansi-console/
ご清聴ありがとうございました。


Source: https://habr.com/ru/post/J45041/


All Articles