[OpenCVthèque-devel] Demande d'aide
Brought to you by:
scoubidoo
From: zacharie d. <d-z...@ca...> - 2008-08-20 15:40:15
|
<html><head><style type="text/css">body{font:12px Arial;margin:3px;overflow-y:auto;overflow-x:auto}p{margin:0px;}blockquote, ol, ul{margin-top:0px;margin-bottom:0px;}</style></head> <body><div style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial"><P>Bonjour, lorsque j'installe ce template, j'ai ce message lorsque j'ouvre l'index avec wamp:</P> <P> </P> <P>"; } /////////////////////////////////// // Définition de l'objet class LogErrors { //////////// CONSTRUCTEURS //////////// function LogErrors($fileName, $msgHeader, $minLevel, $maxFileSize) // maxFileSize en KOctets { $this->_filename = $fileName; $this->_header = $msgHeader; $this->_level = $minLevel; $this->_maxsize = $maxFileSize; } //////////// METHODES PUBLIQUES //////////// // log les messages function log($level, $message, $filename = "", $numline = 0) { if( $level < $this->_level ) { return TRUE; } if( ($fich = fopen($this->_filename, "a+")) ) { $this->_baseLogErrors($fich, $level, $message, $filename, $numline); fseek($fich, 0, SEEK_END); if( ftell($fich) > ($this->_maxsize*1024) ) { // on efface le fichier fclose($fich); $fich = fopen($this->_filename, "w+"); fclose($fich); } else { fclose($fich); } return TRUE; } return FALSE; } //////////// METHODES PRIVEES //////////// function _baseLogErrors($fich, $level, $msg, $filename, $numline) { global $CVT_LOG_LEV; // build message to log if( $this->_header != "" ) { $msg = "[".$this->_header."] ".$msg; } $this->_lastError = "[".date("d/m/y")." ".date("H:i:s")."] ".$CVT_LOG_LEV[$level]." ".$msg; if( $filename != "" ) { $this->_lastError = $this->_lastError." (".$filename.")"; if( $numline != 0 ) { $this->_lastError = $this->_lastError."(".$numline.")"; } } $this->_lastError = $this->_lastError."\r\n"; // log the message in specified file if( $fich != NULL ) { fputs($fich, $this->_lastError); return TRUE; } return FALSE; } //////////// VARIABLES PRIVEES //////////// var $_filename; var $_header; var $_level; var $_lastError;// dernier message d'erreur loggué (reste en mémoire, si jamais erreur fichier log...) var $_maxsize; // en KOctets } /************************ Utilisation: ------------ Dans index.php, un objet $errlog est instancé. Il n'a pas de porté globale. - Dans une page simple, inclue depuis l'index, on peut utiliser directement cette variable. - Dans une fonction, ou une méthode d'objet, la variable n'est pas accessible (portées PHP). On a alors 2 solutions: o modifiée la portée de la variable, par l'appel de: global $errlog; o passer la variable $errlog de index en paramétre de la fonction/méthode, ou dans le constructeur de l'objet. Une fois la variable $errlog accessible, il pour logguer un message suffit simplement d'appeller: $errlog->log(CVT_LOG_INFO, "exemple", __FILE__, __LINE__); ************************/ ?><BR><B>Warning</B>: Cannot modify header information - headers already sent by (output started at C:\wamp\www\essai\commun\logerrors.php:229) in <B>C:\wamp\www\essai\index.php</B> on line <B>59</B></P> <P><STRONG></STRONG> </P> <P><STRONG>Pouvez-vous m'aider, je ne comprend pas l'erreur car mon collégue, n'a pas eu cette erreur avec easy-PHP.</STRONG></P> <P><STRONG></STRONG> </P> <P><STRONG>Merci, d'avance.</STRONG></P> <P><STRONG></STRONG> </P> <P><STRONG>Cordialement.</STRONG></P></br><p style="margin-top:11px;padding-top:3px;background-image: url(http://mail.lycos.co.uk/Images/Mail/_content/dot.gif);background-repeat: repeat-x;background-position: 0px 0px;"><table width="100%" style="border-top: dotted 2px #000000;"><tr><td></td></tr></table><br> Venez découvrir des milliers de célibataires dans votre région et affinez vos recherches grâce à tous les services mis à votre disposition: recherche, annonce vocale, messagerie, photos...<br>><A href="http://meetic.lycos.fr/signup/landing.php?mtcmk=005998 ">Cliquez ici <a/> </div></body></html> |