Пример #1
0
 /**
  * 处理PHP致命错误
  */
 public function handleFatalError()
 {
     if (SKY_ENABLE_ERROR_HANDLER) {
         unset($this->_memoryReserve);
         $error = error_get_last();
         if (!class_exists('\\Sky\\base\\ErrorHandler', false)) {
             require_once __DIR__ . '/../base/ErrorHandler.php';
         }
         if (ErrorHandler::isFatalError($error)) {
             error_log($error['message']);
             $this->displayError($error['type'], $error['message'], $error['file'], $error['line']);
             exit(1);
         }
     }
 }
Пример #2
0
 /**
  * 处理PHP致命错误
  */
 public function handleFatalError()
 {
     if (SKY_ENABLE_ERROR_HANDLER) {
         // 			unset($this->_memoryReserve);
         $error = error_get_last();
         if (!class_exists('\\Sky\\base\\ErrorHandler', false)) {
             require_once __DIR__ . '/ErrorHandler.php';
         }
         if (ErrorHandler::isFatalError($error)) {
             // use error_log because it's too late to use Sky log
             error_log($error['message']);
             if (($handler = $this->getErrorHandler()) !== null) {
                 $handler->handleError($error['type'], $error['message'], $error['file'], $error['line']);
             } else {
                 $this->displayError($error['type'], $error['message'], $error['file'], $error['line']);
             }
             exit(1);
         }
     }
 }