Alternc
latest
Alternc logiel libre pour l'hébergement
|
Handle messages (error, warning, info, ok) appearing in API calls. More...
Public Member Functions | |
__construct () | |
raise ($level="ERROR", $clsid, $msg, $param="") | |
Record a message, insert it into the logfile. More... | |
init_msgs () | |
Reset the stored messages array. More... | |
has_msgs ($level="") | |
Tell if there are stored messages for a specific level or for all levels (if level is empty) More... | |
msg_str ($level="ERROR", $all=true) | |
Return a string of concateneted messages of all recorded messages or only the last message. More... | |
msg_html ($level="ERROR", $all=true) | |
Return a message in HTML form with associated CSS. More... | |
msg_html_all ($all=true, $init=false) | |
Return all the messages of all levels in HTML form with associated CSS. More... | |
logAlternC ($level="ERROR", $arrMsg) | |
Log a message into /var/log/alternc/bureau.log. More... | |
log ($clsid, $function, $param="") | |
Log an API function call into /var/log/alternc/bureau.log. More... | |
debug ($clsid, $function, $param="") | |
Log an API function call into /var/log/alternc/bureau.log. More... | |
Public Attributes | |
$arrMessages = array() | |
Contains the messages and their ID. More... | |
$logfile = "/var/log/alternc/bureau.log" | |
$ARRLEVEL = array("ERROR", "ALERT", "INFO") | |
List of possible message level. More... | |
$ARRCSS | |
CSS classes for each level. More... | |
Handle messages (error, warning, info, ok) appearing in API calls.
This class handles messages appearing while calling API functions of AlternC Those messages are stored as a number (class-id) and a message localized messages are available
This class also handle inserting those messages into the logging system in /var/log/alternc/bureau.log
Definition at line 33 of file m_messages.php.
m_messages::__construct | ( | ) |
m_messages::debug | ( | $clsid, | |
$function, | |||
$param = "" |
|||
) |
Log an API function call into /var/log/alternc/bureau.log.
This function logs in /var/log/alternc an API function call of AlternC
integer | $clsid | Number of the class doing the call |
string | $function | Name of the called function |
string | $param | non-mandatory parameters of the API call |
Definition at line 278 of file m_messages.php.
References $mem, get_remote_ip(), and variable_get().
m_messages::has_msgs | ( | $level = "" | ) |
Tell if there are stored messages for a specific level or for all levels (if level is empty)
string | $level | The level of the msg array to work with (if empty or not set, use all levels) |
Definition at line 107 of file m_messages.php.
Referenced by msg_str().
m_messages::init_msgs | ( | ) |
Reset the stored messages array.
Definition at line 91 of file m_messages.php.
Referenced by __construct(), and msg_html_all().
m_messages::log | ( | $clsid, | |
$function, | |||
$param = "" |
|||
) |
Log an API function call into /var/log/alternc/bureau.log.
This function logs in /var/log/alternc an API function call of AlternC
integer | $clsid | Number of the class doing the call |
string | $function | Name of the called function |
string | $param | non-mandatory parameters of the API call |
Definition at line 258 of file m_messages.php.
References $mem, and get_remote_ip().
m_messages::logAlternC | ( | $level = "ERROR" , |
|
$arrMsg | |||
) |
Log a message into /var/log/alternc/bureau.log.
This function logs the last message in the /var/log/alternc folder allowing sysadmins to know what's happened. automatically called by raise()
string | $level | the error level |
array | $arrMsg | the array containing message info. @access private |
Definition at line 228 of file m_messages.php.
References $mem, and get_remote_ip().
Referenced by raise().
m_messages::msg_html | ( | $level = "ERROR" , |
|
$all = true |
|||
) |
Return a message in HTML form with associated CSS.
string | $level | The level of the msg array to work with |
string | $sep | The separator used to concatenate msgs |
boolean | $all | show all the messages or only the last one |
Definition at line 180 of file m_messages.php.
References msg_str().
Referenced by msg_html_all().
Return all the messages of all levels in HTML form with associated CSS.
string | $sep | The separator used to concatenate msgs |
boolean | $all | show all the messages or only the last one |
Definition at line 204 of file m_messages.php.
References $msg, init_msgs(), and msg_html().
m_messages::msg_str | ( | $level = "ERROR" , |
|
$all = true |
|||
) |
Return a string of concateneted messages of all recorded messages or only the last message.
string | $level | The level of the msg array to work with |
boolean | $all | show all the messages or only the last one |
@access private
Definition at line 132 of file m_messages.php.
References $i, and has_msgs().
Referenced by msg_html().
m_messages::raise | ( | $level = "ERROR" , |
|
$clsid, | |||
$msg, | |||
$param = "" |
|||
) |
Record a message, insert it into the logfile.
This function records a message, add it to the logfile, and make it available for the web panel to print it later.
string | $cat | The category of the msg array to work with |
integer | $clsid | Which class raises this message |
mixed | $msg | The message |
array | $param | Non-mandatory array of string parameter for this message |
Definition at line 69 of file m_messages.php.
References $msg, and logAlternC().
m_messages::$ARRCSS |
CSS classes for each level.
Definition at line 44 of file m_messages.php.
m_messages::$ARRLEVEL = array("ERROR", "ALERT", "INFO") |
List of possible message level.
Definition at line 41 of file m_messages.php.
m_messages::$arrMessages = array() |
Contains the messages and their ID.
Definition at line 36 of file m_messages.php.
m_messages::$logfile = "/var/log/alternc/bureau.log" |
Definition at line 38 of file m_messages.php.