Advertisement
Guest User

Quick 'n' Dirty - Silent Debugger

a guest
Aug 21st, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Gerhard Kollinger (http://kollinger.it/+)
  2. define("MY_IP", "89.23.232.21");
  3.  
  4. function silentDebug($info = NULL, $mixedOutputVar = 'no_value', $dieAfter = NULL, $htmlCommented = TRUE) {
  5.   if($_SERVER['REMOTE_ADDR'] == MY_IP) {
  6.     if($mixedOutputVar != 'no_value') {
  7.       $output = is_array($mixedOutputVar) ? print_r($mixedOutputVar, TRUE) : $mixedOutputVar;
  8.       $output = is_string($output) ? $output : var_export($output, TRUE);
  9.       if($htmlCommented) {
  10.         echo '<!--'.$info.': '.$output.'-->'."\n";
  11.       }else {
  12.         echo $info.': '.$output.'<br />'."\n";
  13.       }
  14.       if($dieAfter) {
  15.         die();
  16.       }
  17.     }
  18.   }
  19.   return;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement