Example #1
0
 public static function debugbox()
 {
     if (!lib::client_is_internal_host()) {
         return '';
     }
     if (lib::$debugboxshown) {
         return '';
     }
     $box = "<div id='debugbox' style='clear: both; margin-top: 8em; margin-bottom: 2em; padding: 4em 0.5em 0px 0.5em;'>";
     $box .= "<table width='100%' border='1' rules='all' cellpadding='4'>\n";
     $_SERVER['runtime'] = lib::runtime();
     $box .= lib::trow('execution time', $_SERVER['runtime']);
     $dbstats = lib::dbstats();
     $box .= lib::trow('database', $dbstats);
     if (isset($_SESSION)) {
         ob_start();
         print_r($_SESSION);
         $msg = ob_get_contents();
         ob_end_clean();
         $msg = preg_replace('/(^Array\\n\\(|\\n\\)$)/', '', $msg);
         $box .= lib::trow('session', "<pre style='margin: 0px; padding: 0px;'>{$msg}</pre>");
     }
     global $__RECMSG;
     if ($__RECMSG) {
         $msg = '<dl style="padding-left: 2em; margin-left: -20px;">';
         foreach ($__RECMSG as $k) {
             $msg .= $k;
         }
         $msg .= '</dl>';
         $box .= lib::trow('messages', $msg);
     } else {
         $box .= lib::trow('messages', "(none)");
     }
     $box .= '</table></div>';
     lib::$debugboxshown = true;
     return $box;
 }