home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / misc / debug.php next >
Encoding:
PHP Script  |  2003-02-06  |  389 b   |  15 lines

  1. <?php
  2. $debug_file = "{$AppUI->cfg['root_dir']}/files/debug.log";
  3.  
  4. function writeDebug( $s, $t='', $f='?', $l='?' ) {
  5.     GLOBAL $debug, $debug_file;
  6.     if ( $debug && ($fp = fopen( $debug_file, "at" ))) {
  7.         fputs( $fp, "Debug message from file [$f], line [$l], at: ".strftime( "%H:%S" ) );
  8.         if ($t) {
  9.             fputs( $fp, "\n * * $t * *\n" );
  10.         }
  11.         fputs( $fp, "\n$s\n\n" );
  12.         fclose( $fp );
  13.     }
  14. }
  15. ?>