Skip to content

Commit

Permalink
Delete php error reporting for production environment, added php erro…
Browse files Browse the repository at this point in the history
…r reporting for testing environment
  • Loading branch information
N3Cr0N committed Mar 12, 2019
1 parent 23a94e9 commit 4e60548
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,18 @@
break;

case 'testing':
break;

case 'production':
ini_set('display_errors', 0);
ini_set('display_errors', 1);
if (version_compare(PHP_VERSION, '5.3', '>=')) {
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
} else {
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;

case 'production':
ini_set('display_errors', 0);
break;

default:
header('HTTP/1.1 503 Service Unavailable.', true, 503);
echo 'The application environment is not set correctly.';
Expand Down

0 comments on commit 4e60548

Please sign in to comment.