Example #1
0
 /**
  * Print out system variables.
  *
  * @param string $type The type e.g. "get", "post" etc.
  *
  * @return void
  */
 public static function printSysVars($type = 'all')
 {
     //-- Get debugger type
     $debug_type = JComponentHelper::getParams('com_easycreator')->get('ecr_debug_type', 'easy');
     switch ($debug_type) {
         case 'jdump':
             //-- Test if JDump is installed
             if (!file_exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_dump' . DS . 'helper.php')) {
                 EcrHtml::message(jgettext('JDump not found'), 'error');
             } else {
                 switch ($type) {
                     // @codingStandardsIgnoreStart - use of superglobals
                     case 'get':
                         dump($_GET, 'GET');
                         break;
                     case 'post':
                         dump($_POST, 'POST');
                         break;
                     case 'request':
                         dump($_REQUEST, 'REQUEST');
                         break;
                     case 'backTrace':
                         dumpBacktrace();
                         break;
                     case 'sysInfo':
                     default:
                         dumpSysinfo();
                         break;
                         // @codingStandardsIgnoreEnd
                 }
                 //switch
             }
         case 'easy':
             include_once 'Var_Dump.php';
             if (class_exists('Var_Dump')) {
                 Var_Dump::displayInit(array('display_mode' => 'HTML4_Table'), array('show_caption' => FALSE, 'bordercolor' => '#ccc', 'bordersize' => '2', 'captioncolor' => 'black', 'cellpadding' => '8', 'cellspacing' => '5', 'color1' => '#000', 'color2' => '#000', 'before_num_key' => '<span style="color: #fff; font-weight: bold;">', 'after_num_key' => '</span>', 'before_str_key' => '<span style="color: #5450cc; font-weight: bold;">', 'after_str_key' => '</span>', 'before_value' => '<span style="color: #5450cc;">', 'after_value' => '</span>'));
                 echo '<div class="ecr_debug">';
                 switch ($type) {
                     // @codingStandardsIgnoreStart - use of superglobals
                     case 'get':
                         echo '<h3><tt>$_GET</tt></h3>';
                         Var_Dump::display($_GET);
                         break;
                     case 'post':
                         echo '<h3><tt>$_POST</tt></h3>';
                         Var_Dump::display($_POST);
                         break;
                     case 'request':
                         echo '<h3><tt>$_REQUEST</tt></h3>';
                         Var_Dump::display($_REQUEST);
                         break;
                     case 'all':
                         echo '<h3><tt>$_REQUEST</tt></h3>';
                         Var_Dump::display($_REQUEST);
                         echo '<h3><tt>$_SESSION</tt></h3>';
                         Var_Dump::display($_SESSION);
                         break;
                         // @codingStandardsIgnoreEnd
                 }
                 //switch
                 echo '</div>';
             } else {
                 echo '<div class="ecr_debug"><pre>';
                 // @codingStandardsIgnoreStart - use of superglobals
                 print_r($_REQUEST);
                 // @codingStandardsIgnoreEnd
                 echo '</pre></div>';
             }
             break;
         case 'debugtools':
             EcrHtml::message(jgettext('DebugTools not found'), 'error');
             break;
         case 'krumo':
             ecrLoadHelper('krumo_0_2.krumo');
             switch ($type) {
                 case 'get':
                     krumo::get();
                     break;
                 case 'post':
                     krumo::post();
                     break;
                 case 'request':
                     krumo::request();
                     break;
                 case 'all':
                     krumo::get();
                     krumo::post();
                     krumo::session();
                     break;
             }
             //switch
             break;
         default:
             EcrHtml::message(jgettext('No debugger set'), 'error');
             break;
     }
     //switch
 }