74 $args = func_get_args();
75 $this->param=array_slice($args, 2);
81 $this->param=
"Error # $error in Class $clsid, Value is $param. (sorry, no text for this error in your language at the moment)";
98 if (is_string($this->error)) {
100 $str = $this->error.
"\n";
103 $str = _(
"err_".$this->clsid.
"_".$this->error).
"\n";
106 if (is_array($args)) {
107 array_unshift($args, $str);
108 $msg = call_user_func_array(
"sprintf", $args);
125 @file_put_contents($this->logfile, date(
"d/m/Y H:i:s").
" - ERROR - ".
$mem->user[
"login"].
" - ".$this->errstr(), FILE_APPEND );
144 return @file_put_contents($this->logfile,date(
"d/m/Y H:i:s").
" - " .
get_remote_ip().
" - CALL - ".
$mem->user[
"login"].
" - $clsid - $function - $param\n", FILE_APPEND );
151 $trace = debug_backtrace();
152 if (isset($trace[2])) {
155 $caller =
"UNKNOWN CALLER";
157 $msg->raise(
"info",
"err",
"Deprecation warning: The old messaging class is still used by ".json_encode($caller));
Classe de gestion des erreurs apparaissant lors d'appels API.
deprecated()
This method is present in order to allow slow deprecation.
log($clsid, $function, $param="")
Envoi un log d'appel d'API dans /var/log/alternc/bureau.log.
logerr()
Envoi un log d'erreur dans /var/log/alternc/bureau.log.
errstr()
Retourne la chaine d'erreur correspondant à la dernière erreur rencontrée.
$logfile
Emplacement du fichier de logs d'AlternC.
$param
Paramètre chaine eventuellement associé à la dernière erreur.
$clsid
Numero de classe d'erreur actuelle.
$error
Dernière erreur enregistrée par la classe.
get_remote_ip()
Return the remote IP.