| 
<?php
date_default_timezone_set('Europe/Kiev');
 
 function Foo() {
 global $Debug;
 $Debug->AddMessage(__FILE__.': '.__CLASS__.' -> '.__FUNCTION__);
 }
 
 class Some {
 function MyFunc() {
 global $Debug;
 $Debug->AddMessage(__FILE__.': '.__CLASS__.' -> '.__FUNCTION__);
 }
 }
 
 include_once('debug.class.php');
 
 /*
 Class initialisation:
 first param - folder for saving reports (must be writable)
 second param - save error into file on any error
 */
 $Debug = new Debug('log', true);
 $var = 25;
 $Debug->AddMessage('$var', $var); // add to report user message (name and value of variable);
 
 Foo(); // execute function, that add message to report
 
 $x = 5 / 0; // make nonfatal error
 
 $Some = new Some();
 $Some->MyFunc(); // execute function of class, that add message to report
 
 $Debug->End(true); // Debug end (always in the end of script). If true - report saving into file always, if false - report saving into file only in error
 ?>
 |