getenv
thermage/thermage
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets the value of an environment variable
getenv
(
string $varname
,
bool $local_only
=
false
):
string
|
false
$g
= (
$color
>>
8
) &
255
;
$b
=
$color
&
255
;
if (
getenv
(
'COLORTERM'
) !==
'truecolor'
) {
return (string)
$this
->
degradeHexColorToAnsi
(
$r
,
$g
,
$b
);
}
src/Base/Color.php
public function
getWidth
():
int
{
$width
=
getenv
(
'COLUMNS'
);
if (
$width
!==
false
) {
return (int)
trim
(
$width
);
}
src/Base/Terminal.php
public function
getHeight
():
int
{
$height
=
getenv
(
'LINES'
);
if (
$height
!==
false
) {
return (int)
trim
(
$height
);
}
src/Base/Terminal.php
private function
initDimensions
():
void
{
if (
DIRECTORY_SEPARATOR
===
'\\'
) {
if (
preg_match
(
'/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/'
,
trim
(
getenv
(
'ANSICON'
)),
$matches
)) {
self
::
$width
= (int)
$matches
[
1
];
src/Base/Terminal.php