MediaWiki  REL1_19
MWTerm.php
Go to the documentation of this file.
00001 <?php
00002 
00012 class AnsiTermColorer {
00013         function __construct() {
00014         }
00015 
00022         public function color( $color ) {
00023                 global $wgCommandLineDarkBg;
00024 
00025                 $light = $wgCommandLineDarkBg ? "1;" : "0;";
00026 
00027                 return "\x1b[{$light}{$color}m";
00028         }
00029 
00035         public function reset() {
00036                 return $this->color( 0 );
00037         }
00038 }
00039 
00040 /* A colour-less terminal */
00041 class DummyTermColorer {
00042         public function color( $color ) {
00043                 return '';
00044         }
00045 
00046         public function reset() {
00047                 return '';
00048         }
00049 }
00050