New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to PHP error handling. #2203

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@pavlepredic

pavlepredic commented Mar 13, 2013

This commit attempts to solve a problem of minor PHP errors causing the app to exit. App will now exit only if the error event was not handled, allowing developers to set up custom error handlers that will ignore certain types of errors (eg notices). PHP errors are also logged using an appropriate level, depending on error code (E_ERROR, E_NOTICE etc). A shutdown function is also registered to attempt to catch fatal errors (and at least log them).

See here for more details:
http://www.yiiframework.com/forum/index.php/topic/41244-handling-php-errors/

Pavle Predic
Changes to PHP error handling. Do not end app if an error event is ha…
…ndled. Also catch fatal errors during script shutdown.
@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 13, 2013

Member

The proper (expected) way of ignoring certain types of PHP errors is via the error_reporting PHP setting.

For 1.1, because we want to keep the codebase as stable as possible, we will not try to catch fatal errors using shutdown functions. We will do this in 2.0.

Member

qiangxue commented Mar 13, 2013

The proper (expected) way of ignoring certain types of PHP errors is via the error_reporting PHP setting.

For 1.1, because we want to keep the codebase as stable as possible, we will not try to catch fatal errors using shutdown functions. We will do this in 2.0.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 13, 2013

Member

So should handling of errors in 1.1 be changed to reflect error_reporting?

Member

samdark commented Mar 13, 2013

So should handling of errors in 1.1 be changed to reflect error_reporting?

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 13, 2013

Member

It is already so. See: set_error_handler(array($this,'handleError'),error_reporting());

Member

qiangxue commented Mar 13, 2013

It is already so. See: set_error_handler(array($this,'handleError'),error_reporting());

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 13, 2013

Member

Right. @pavlepredic I think this pull request will not make it.

Member

samdark commented Mar 13, 2013

Right. @pavlepredic I think this pull request will not make it.

@samdark samdark closed this Mar 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment