Example #1
0
 /**
  * Run the debugger to handle all exception and
  * display stack trace
  *
  *
  */
 public function run()
 {
     $handler = $this;
     $this->setCollapsePaths();
     //Add new panel to debug bar
     $this->addPanel(function ($e) use($handler) {
         if (!is_null($path = $handler->assetsPath())) {
             $contents = $handler->includeAssets($path);
         }
         if (!is_null($e)) {
             if ($handler->enableLogging == true) {
                 $this->log($e);
             }
             return array('tab' => $handler->name, 'panel' => '<h1>
                     <span class="heading-blue">
                     <a href="http://www.cygniteframework.com">' . $handler->name . ' </a>
                     </span>
                     </h1>
                     <p> Version : ' . Application::version() . ' </p>
                     <style type="text/css" class="tracy-debug">' . $contents . '</style>');
         }
     });
     $this->addPanel(function ($e) {
         if (!$e instanceof \PDOException) {
             return;
         }
         if (isset($e->queryString)) {
             $sql = $e->queryString;
         }
         return isset($sql) ? array('tab' => 'SQL', 'panel' => $sql) : NULL;
     });
 }