Skip to content
This repository
Browse code

MINOR error_reporting() now defaults to E_ALL | E_STRICT which means

strict errors are now reported *unless* the site is in live mode (which
supresses everything except fatal errors and warnings)
  • Loading branch information...
commit 630bfcc823494b13a2c01ace49ad3471a79e4fc2 1 parent 6a10ed1
Sean Harvey authored April 12, 2012

Showing 1 changed file with 7 additions and 8 deletions. Show diff stats Hide diff stats

  1. 15  core/Core.php
15  core/Core.php
@@ -38,8 +38,9 @@
38 38
 ///////////////////////////////////////////////////////////////////////////////
39 39
 // ENVIRONMENT CONFIG
40 40
 
41  
-if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_STRICT));
42  
-else error_reporting(E_ALL);
  41
+// ALL errors are reported, including E_STRICT by default *unless* the site is in
  42
+// live mode, where reporting is limited to fatal errors and warnings (see later in this file)
  43
+error_reporting(E_ALL | E_STRICT);
43 44
 
44 45
 /**
45 46
  * Include _ss_environment.php files
@@ -253,13 +254,11 @@
253 254
 	BASE_PATH, false, isset($_GET['flush'])
254 255
 ));
255 256
 
256  
-// If this is a dev site, enable php error reporting
257  
-// This is necessary to force developers to acknowledge and fix
258  
-// notice level errors (you can override this directive in your _config.php)
259  
-if (Director::isLive()) {
260  
-	if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT | E_NOTICE));
261  
-	else error_reporting(E_ALL & ~E_NOTICE);
  257
+// If in live mode, ensure deprecation, strict and notices are not reported
  258
+if(Director::isLive()) {
  259
+	error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT | E_NOTICE));
262 260
 }
  261
+
263 262
 ///////////////////////////////////////////////////////////////////////////////
264 263
 // POST-MANIFEST COMMANDS
265 264
 

0 notes on commit 630bfcc

Please sign in to comment.
Something went wrong with that request. Please try again.