From 67e427cdf6f2ed029de312e53dc72ea2d5c13bb8 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 13 Aug 2008 21:49:52 +0000 Subject: [PATCH] BUGFIX Reinstated error_handling(E_ALL) for dev environments in main.php after clarifying with sam - we want to force developers to recard notice-level errors unless they expicitly opt-out in their _config.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60643 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/Debug.php | 5 +++-- main.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/Debug.php b/dev/Debug.php index bb6d99272..a834a92ef 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -204,10 +204,10 @@ class Debug { } /** - * Load error handlers into environment + * Load error handlers into environment. + * Caution: The error levels default to E_ALL is the site is in dev-mode (set in main.php). */ static function loadErrorHandlers() { - //set_error_handler('errorHandler', (E_ALL ^ E_NOTICE) ^ E_USER_NOTICE); set_error_handler('errorHandler', error_reporting()); set_exception_handler('exceptionHandler'); } @@ -615,6 +615,7 @@ function exceptionHandler($exception) { /** * Generic callback to catch standard PHP runtime errors thrown by the interpreter * or manually triggered with the user_error function. + * Caution: The error levels default to E_ALL is the site is in dev-mode (set in main.php). * * @ignore * @param unknown_type $errno diff --git a/main.php b/main.php index 49dbf268d..f120a1ab1 100644 --- a/main.php +++ b/main.php @@ -95,12 +95,12 @@ require_once('core/control/Director.php'); require_once('filesystem/Filesystem.php'); require_once("core/Session.php"); -/* - // If this is a dev site, enable php error reporting +// If this is a dev site, enable php error reporting +// This is necessary to force developers to acknowledge and fix +// notice level errors (you can override this directive in your _config.php) if (Director::isDev()) { error_reporting(E_ALL); } -*/ Session::start();