Welcome Guest, Not a member yet? Register   Sign In
Starting with CodeIgniter setup: suggestions & best practices
#64

[eluser]Smithv[/eluser]
[quote author="Jelmer" date="1253721785"]Someone mentioned an inconsistancy to me about error reporting. It used to say:
Quote:On any public site error_reporting should be set to E_ERROR
And then I went on to set error reporting to 0 instead of E_ERROR.

E_ERROR essentially means 1 and is as such one level more reporting than 0 (none at all). According to php.net, setting error reporting to E_ERROR means:
Quote:Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted.

My view is that in a live site any error should be either written by me (the programmer) or not shown at all. The users shouldn't know, remove duplicate files what went wrong except when I explicitly told the system what it should tell the user. Which is why in the example code error reporting is set to 0 and not to E_ERROR.

Which is why I've changed the suggested error reporting to 0 instead of E_ERROR for any live site. I've corrected the comment explanation of the levels in the error reporting switch code because in the PHP code 1 means fatal errors & DB errors (instead of only DB errors) and 2 means compiler errors & db errors (instead of fatal & db errors). Also I've added a link to the error reporting pre-defined constants on php.net (http://nl2.php.net/manual/en/errorfunc.constants.php).[/quote]

Thank You Thanks For Helping Me!!!!!


Messages In This Thread
Starting with CodeIgniter setup: suggestions & best practices - by El Forum - 12-25-2010, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB