MediaWiki
1.34.0
MWTerm.php
Go to the documentation of this file.
1
<?php
39
class
AnsiTermColorer
{
40
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
72
class
DummyTermColorer
{
73
public
function
color
( $color ) {
74
return
''
;
75
}
76
77
public
function
reset
() {
78
return
''
;
79
}
80
}
DummyTermColorer
A colour-less terminal.
Definition:
MWTerm.php:72
AnsiTermColorer\reset
reset()
Return ANSI terminal escape code for restoring default text attributes.
Definition:
MWTerm.php:62
DummyTermColorer\reset
reset()
Definition:
MWTerm.php:77
DummyTermColorer\color
color( $color)
Definition:
MWTerm.php:73
$wgCommandLineDarkBg
$wgCommandLineDarkBg
For colorized maintenance script output, is your terminal background dark ?
Definition:
DefaultSettings.php:6725
AnsiTermColorer
Terminal that supports ANSI escape sequences.
Definition:
MWTerm.php:39
AnsiTermColorer\color
color( $color)
Return ANSI terminal escape code for changing text attribs/color.
Definition:
MWTerm.php:49
AnsiTermColorer\__construct
__construct()
Definition:
MWTerm.php:40
maintenance
term
MWTerm.php
Generated on Thu Dec 19 2019 14:55:35 for MediaWiki by
1.8.16