Merge "Destroy any lock manager connections when forking."
[mediawiki.git] / maintenance / term / MWTerm.php
blob36fb8eec090924cb205b250b197df64794448633
1 <?php
3 /**
4 * @ingroup Testing
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() {
16 /**
17 * Return ANSI terminal escape code for changing text attribs/color
19 * @param $color String: semicolon-separated list of attribute/color codes
20 * @return String
22 public function color( $color ) {
23 global $wgCommandLineDarkBg;
25 $light = $wgCommandLineDarkBg ? "1;" : "0;";
27 return "\x1b[{$light}{$color}m";
30 /**
31 * Return ANSI terminal escape code for restoring default text attributes
33 * @return String
35 public function reset() {
36 return $this->color( 0 );
40 /* A colour-less terminal */
41 class DummyTermColorer {
42 public function color( $color ) {
43 return '';
46 public function reset() {
47 return '';