6 * Set of classes to help with test output and such. Right now pretty specific
7 * to the parser tests but could be more useful one day :)
9 * @todo Fixme: Make this more generic
12 class AnsiTermColorer
{
13 function __construct() {
17 * Return ANSI terminal escape code for changing text attribs/color
19 * @param $color String: semicolon-separated list of attribute/color codes
22 public function color( $color ) {
23 global $wgCommandLineDarkBg;
25 $light = $wgCommandLineDarkBg ?
"1;" : "0;";
27 return "\x1b[{$light}{$color}m";
31 * Return ANSI terminal escape code for restoring default text attributes
35 public function reset() {
36 return $this->color( 0 );
40 /* A colour-less terminal */
41 class DummyTermColorer
{
42 public function color( $color ) {
46 public function reset() {