From f2474a0ae2cf8460a05a68c1a5334f79a38c70d4 Mon Sep 17 00:00:00 2001 From: Hayden Smith Date: Wed, 8 Oct 2008 03:35:28 +0000 Subject: [PATCH] Moved error_reporting setting from main.php to Core.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63821 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Core.php | 9 ++++++++- main.php | 7 ------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/Core.php b/core/Core.php index 8df6f116b..064437e7f 100755 --- a/core/Core.php +++ b/core/Core.php @@ -21,6 +21,8 @@ /////////////////////////////////////////////////////////////////////////////// // ENVIRONMENT CONFIG +error_reporting(E_ALL); + /** * Include _ss_environment.php files */ @@ -169,7 +171,12 @@ require_once(MANIFEST_FILE); */ if(isset($_GET['debugmanifest'])) Debug::show(file_get_contents(MANIFEST_FILE)); - +// 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::isLive()) { + error_reporting(E_ALL ^ E_NOTICE); +} /////////////////////////////////////////////////////////////////////////////// // POST-MANIFEST COMMANDS diff --git a/main.php b/main.php index adb7f78a4..bea8b3935 100644 --- a/main.php +++ b/main.php @@ -47,13 +47,6 @@ if (function_exists('mb_http_output')) { mb_internal_encoding('UTF-8'); } -// 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(); // Apache rewrite rules use this