示例#1
0
文件: Debug.php 项目: nvarney/dwa
 public static function info()
 {
     // disable in production, except from PJ HQ ip address
     if (isset($_GET['debug']) && strtolower($_GET['debug']) != "false") {
         // debug block w/ execution time and router info
         echo PHP_EOL . '<div style="font-family: monospace; font-size: 13px; width: 80%; margin: 20px auto;"><b style="color: #008800;">DEBUG INFO</b><br/>' . PHP_EOL;
         echo '<b>Routed Controller/Method:</b> ' . Router::$controller . '/' . Router::$method . '<br/>' . PHP_EOL;
         echo '<b>Execution Time:</b> ' . EXECUTION_TIME . ' sec' . PHP_EOL;
         // show mysql query history
         echo DB::instance()->query_history() . PHP_EOL;
         // show included files
         krumo::includes(FALSE) . PHP_EOL;
         echo '<br/></div>' . PHP_EOL;
         // disable krumo in production
     } elseif (IN_PRODUCTION) {
         // disable krumo output
         krumo::disable();
     }
 }
示例#2
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;
         }
     }
 }
if ($oEvent->installed_plugin('debug')) {

    MyOOS_CoreApi::requireOnce('lib/krumo/class.krumo.php');

    echo '$_SESSION';
    krumo($_SESSION);

    echo '$_GET'; 
    krumo($_GET);

    echo '$_POST';
    krumo($_POST); 

    // print all the included(or required) files 
    krumo::includes();
 
    // print all the included functions 
    krumo::functions();
 
    // print all the declared classes 
    krumo::classes();
 
    // print all the defined constants 
    krumo::defines();     
}

// shopping_cart
if (isset($_SESSION['new_products_id_in_cart'])) {
    unset($_SESSION['new_products_id_in_cart']);
}