Skip to content

Commit

Permalink
解决HHVM下错误页返回空白的问题
Browse files Browse the repository at this point in the history
参见facebook/hhvm#4055 throw new
Exception后注册的事件内不可退出。
  • Loading branch information
zsxsoft committed Feb 4, 2015
1 parent c350526 commit f88e6e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zb_system/function/c_system_debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Debug_Error_Handler($errno, $errstr, $errfile, $errline) {
$zbe = ZBlogException::GetInstance();
$zbe->ParseError($errno, $errstr, $errfile, $errline);
$zbe->Display();
die();
if (!IS_HHVM) exit();

}

Expand All @@ -122,7 +122,7 @@ function Debug_Exception_Handler($exception) {
$zbe = ZBlogException::GetInstance();
$zbe->ParseException($exception);
$zbe->Display();
die();
if (!IS_HHVM) exit();
}

/**
Expand Down Expand Up @@ -162,7 +162,7 @@ function Debug_Shutdown_Handler() {
$zbe = ZBlogException::GetInstance();
$zbe->ParseShutdown($error);
$zbe->Display();
die();
if (!IS_HHVM) exit();
}
}

Expand Down Expand Up @@ -370,7 +370,7 @@ function Display() {

require dirname(__FILE__) . '/../defend/error.html';
RunTime();
die();
if (!IS_HHVM) exit();
}

/**
Expand Down

4 comments on commit f88e6e4

@wozzup
Copy link

@wozzup wozzup commented on f88e6e4 Mar 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HHVM 3.3 已经解决了 die exit 的问题了吧?facebook/hhvm#993

@zsxsoft
Copy link
Contributor Author

@zsxsoft zsxsoft commented on f88e6e4 Mar 9, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colin-kiegel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip:
flush(); exit(1);

This will mimic the default behaviour of php in HHVM inside error and exception handlers.

@zsxsoft
Copy link
Contributor Author

@zsxsoft zsxsoft commented on f88e6e4 Apr 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colin-kiegel
Thx! Now I don't have any server installed HHVM, so I submitted a new issue(#32). It will be closed if other member test.

Please sign in to comment.