MediaWiki  master
MWTerm.php
Go to the documentation of this file.
1 <?php
40  public function __construct() {
41  }
42 
49  public function color( $color ) {
50  global $wgCommandLineDarkBg;
51 
52  $light = $wgCommandLineDarkBg ? "1;" : "0;";
53 
54  return "\x1b[{$light}{$color}m";
55  }
56 
62  public function reset() {
63  return $this->color( 0 );
64  }
65 }
66 
73  public function color( $color ) {
74  return '';
75  }
76 
77  public function reset() {
78  return '';
79  }
80 }
reset()
Return ANSI terminal escape code for restoring default text attributes.
Definition: MWTerm.php:62
$wgCommandLineDarkBg
For colorized maintenance script output, is your terminal background dark ?
color( $color)
Definition: MWTerm.php:73
A colour-less terminal.
Definition: MWTerm.php:72
Terminal that supports ANSI escape sequences.
Definition: MWTerm.php:39
color( $color)
Return ANSI terminal escape code for changing text attribs/color.
Definition: MWTerm.php:49