F:\WEBSITES\testbed\zipped\yabb_svn_new\branches\2.5.2\cgi-bin\yabb2\Sources\Debug.pl F:\WEBSITES\testbed\zipped\yabb_svn_new\trunk\cgi-bin\yabb2\Sources\Debug.pm
############################################################################### ###############################################################################
# Debug.pl                                                                    # # Debug.pm                                                                    #
  # $Date: 01.05.16 $                                                           #
############################################################################### ###############################################################################
# YaBB: Yet another Bulletin Board                                            # # YaBB: Yet another Bulletin Board                                            #
# Open-Source Community Software for Webmasters                               # # Open-Source Community Software for Webmasters                               #
# Version:        YaBB 2.5.2                                                  # # Version:        YaBB 2.6.12                                                 #
# Packaged:       October 21, 2012                                            # # Packaged:       January 5, 2016                                             #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved.     #
# Software by:  The YaBB Development Team                                     # # Software by:  The YaBB Development Team                                     #
#               with assistance from the YaBB community.                      # #               with assistance from the YaBB community.                      #
############################################################################### ###############################################################################
  our $VERSION = '2.6.12';
   
$debugplver = 'YaBB 2.5.2 $Revision: 1.0 $'; $debugpmver = 'YaBB 2.6.12 $Revision: 1651 $';
   
sub Debug { sub Debug {
   if ($debug == 1 or ($debug == 2 && $iamadmin)) {    if ( $debug == 1 || ( $debug == 2 && ( $iamadmin || $iamgmod ) ) || $debug == 3 ) {
       $yyfileactions = "$debug_txt{'opened'} $file_open $debug_txt{'closed'} $file_close $debug_txt{'equal'}";         $yyfileactions = 
  "$debug_txt{'opened'} $file_open $debug_txt{'closed'} $file_close $debug_txt{'equal'}";
       my $yytimeclock;  
       my $time_running = time - $START_TIME;         my $yytimeclock; 
       if ($time_running == int($time_running)) {         my $time_running = time - $START_TIME; 
           $yytimeclock = "$debug_txt{'nohires'} Time::Hires $debug_txt{'nomodule'}<br />";         if ( $time_running == int $time_running ) { 
       } else {             $yytimeclock = 
           $time_running = sprintf("%.4f", $time_running);               "$debug_txt{'nohires'} Time::Hires $debug_txt{'nomodule'}<br />"; 
       }        }
       $yytimeclock .= "$debug_txt{'pagespeed'} $time_running $debug_txt{'loaded'}.";         else { 
             $time_running = sprintf '%.4f', $time_running;
       &ToHTML($openfiles);         } 
       $openfiles =~ s/\n/<br \/>/g;         $yytimeclock .= 
           "$debug_txt{'pagespeed'} $time_running $debug_txt{'loaded'}.";
       $yydebug = qq~<br /><div class="small" style="float: left; padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"><u>$debug_txt{'debugging'}</u><br /><br /><u>$debug_txt{'benchmarking'}:</u><br />$yytimeclock<br /><br /><u>$debug_txt{'ipaddress'}:</u><br />$user_ip<br /><br /><u>$debug_txt{'browser'}:</u><br />$ENV{'HTTP_USER_AGENT'}<br />$getpairs<br /><u>$debug_txt{'trace'}:</u>$yytrace<br /><br /><u>$debug_txt{'check'}:</u><br />$yyfileactions<br /><br /><u>$debug_txt{'filehandles'}:</u><br />$debug_txt{'filehandleslegend'}<br /><br />$openfiles<br /><u>$debug_txt{'filesloaded'}:<tt>require</tt></u>~;  
         ToHTML($openfiles);
       foreach (sort(keys(%INC))) {$yydebug .= qq~<br />$_ => $INC{$_}~;}         $openfiles =~ s/\n/<br \/>/gxsm; 
   
       $yydebug .= qq~<br /><br /><br /></div>~;         $yydebug = 
   }  qq~<br /><div class="small debug"><span class="under">$debug_txt{'debugging'}<span><br /><br /><span class="under">$debug_txt{'benchmarking'}:</span><br />$yytimeclock<br /><br /><span class="under">$debug_txt{'ipaddress'}:</span><br />$user_ip<br /><br /><span class="under">$debug_txt{'browser'}:</span><br />$ENV{'HTTP_USER_AGENT'}<br />$getpairs<br /><span class="under">$debug_txt{'trace'}:</span>$yytrace<br /><br /><span class="under">$debug_txt{'check'}:</span><br />$yyfileactions<br /><br /><span class="under">$debug_txt{'filehandles'}:</span><br />$debug_txt{'filehandleslegend'}<br /><br />$openfiles<br /><span class="under">$debug_txt{'filesloaded'}:<span class="tt">require</span></span>~; 
   
         foreach ( sort keys %INC ) { $yydebug .= qq~<br />$_ => $INC{$_}~; }
   
         $yydebug .= q~<br /><br /><br />
     </div>~;
         if ( $debug == 3 ) {
             $yydebug =
               qq~<br /><div class="small center debug">$yytimeclock</div>~;
         }
     }
     return $yydebug;
} }
   
1; 1;