Ejemplo n.º 1
0
 /**
  * Will return the content generated by the KRUMO plugin. We use the KRUMO to automatically dump the variables generat @ run-time,
  * when an error occured to help the develper quickly debug some of it's variables. This helps him skip some var_dump () actions
  * just to check the content of a variable, which we can do with just a mouse-click in the echoed browser error-screen;
  *
  * @return S Catched Krumo contented, parsed by the KRUMO plugin, for error/variable dumping
  * @author Catalin Z. Alexandru <*****@*****.**>
  * @copyright Under the terms of the GNU General Public License v3
  * @version $Id: 08_ERR.php 313 2009-10-09 13:27:52Z catalin.zamfir $
  * @since Version 1.0
  * @access private
  * @static
  * @final
  */
 private static final function getKrumoContent()
 {
     // Determine if we can KRUMO, only if the ERR has passed;
     // If _GET instanceof A, means that the our URL parser has loaded;
     if (isset($_GET)) {
         if ($_GET instanceof A) {
             // Execute the KRUMO Framework PLUGIN;
             // Wished we could've made an object out of Krumo, but we will call it statically ...
             krumo::get();
             krumo::post();
             krumo::session();
             krumo::cookie();
             krumo::headers();
             krumo::includes();
             krumo::server();
             krumo::env();
             krumo::conf();
             krumo::extensions();
             krumo::interfaces();
             krumo::path();
             // Get its content;
             $catchedKrumoContent = self::getContentFromOutputStream();
             // Save it, and then clean the stream again;
             self::discardOutputStream(new B(TRUE));
             // Yey! It's over!
             return $catchedKrumoContent;
         }
     }
 }
Ejemplo n.º 2
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
 }