dolibarr
21.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
core
lib
functionscli.lib.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
* or see https://www.gnu.org/
17
*/
18
26
// Define ANSI color constant to use colors and bold in CLI script
27
define(
'DOL_COLOR_RESET'
,
"\033[0m"
);
// Restore color
28
define(
'DOL_COLOR_BOLD'
,
"\033[1m"
);
// Bold
29
define(
'DOL_COLOR_RED'
,
"\033[31m"
);
30
define(
'DOL_COLOR_GREEN'
,
"\033[32m"
);
31
define(
'DOL_COLOR_YELLOW'
,
"\033[33m"
);
32
define(
'DOL_COLOR_BLUE'
,
"\033[34m"
);
33
define(
'DOL_COLOR_MAGENTA'
,
"\033[35m"
);
34
define(
'DOL_COLOR_CYAN'
,
"\033[36m"
);
35
define(
'DOL_COLOR_WHITE'
,
"\033[37m"
);
36
37
46
function
coloredText
($text, $color, $bold =
false
)
47
{
48
$boldCode = $bold ? DOL_COLOR_BOLD :
''
;
49
return
$boldCode . $color . $text . DOL_COLOR_RESET;
50
}
coloredText
coloredText($text, $color, $bold=false)
Output text in color or bold.
Definition
functionscli.lib.php:46
Generated on Fri Nov 1 2024 01:00:27 for
dolibarr
by Doxygen 1.11.0