コード例 #1
0
 /**
  * 错误
  * @return [type]     [description]
  */
 public function initErr()
 {
     if (DEBUG) {
         ini_set('display_errors', 1);
         error_reporting(E_ALL);
         $whoops = new Run();
         $handler = new PrettyPageHandler();
         $whoops->pushHandler($handler);
         $whoops->register();
     } else {
         ini_set('display_errors', 0);
         error_reporting(0);
     }
     if (isset($_GET['debug']) && $_GET['debug'] == 'safe') {
         Debug::enable();
     }
 }
コード例 #2
0
 public function __destruct()
 {
     if (Y::getParams('debug') && Y::getParams('debug') == 'safe') {
         //开启xhprof
         Debug::disable();
     }
 }