PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Johan Barbier  >  PHP Debugger and Helper  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP Debugger and Helper
Log errors and check PHP code
Author: By
Last change: added usage of __get () method
Date: 15 years ago
Size: 1,214 bytes


Class file image Download
('Content-type: text/html; charset=utf-8');

$odebug = new odebugger ('FR'); // French localization
//$odebug = new odebugger ('EN'); // uncomment this one to localize to English

$odebug -> CSS = 'default'; // set the CSS
$odebug -> HTML = 'default'; // set the HTML template

* realtime example
echo 'bla';
'<br />', 'bli';
$a; // Gasp, undefined!

echo '<br />truc';
'<br />oula';
$b; // bad girl : again undefined!

//$odebug -> ERROR = false; // test to see if turning off the class error handler is effective. And, indeed, it is :-) (commented line, hey, remove to see)
echo $aTab[nom];
//$odebug -> ERROR = true; // switching it back on (commented line, hey, remove to see)

// Let's see how it handles user defined errors (no translation, no suggestion, of course)
if (!isset ($c)) {
trigger_error ('La variable c n\'est pas définie', E_USER_WARNING);

'LINES : ', $odebug -> LINES;

// Let's see how it handles exceptions !
if (!isset ($e)) {
    throw new
Exception('Lancement d\'une exception !');

file_get_contents ('idonotexist.php'); // this file does not exist!


For more information send a message to info at phpclasses dot org.