I have the following code to manage error reporting. I am trying to make it possible to bind error logs on our server, but I do not want the page to display errors. I'm not trying to just make mistakes, we don’t have them.
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
ini_set('display_errors', 'Off');
break;
default:
exit('The application environment is not set correctly.');
}
}
source
share