Skip to content

Commit

Permalink
MINOR error_reporting() now defaults to E_ALL | E_STRICT which means
Browse files Browse the repository at this point in the history
strict errors are now reported *unless* the site is in live mode (which
supresses everything except fatal errors and warnings)
  • Loading branch information
Sean Harvey committed Apr 12, 2012
1 parent 6a10ed1 commit 630bfcc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
///////////////////////////////////////////////////////////////////////////////
// ENVIRONMENT CONFIG

if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_STRICT));
else error_reporting(E_ALL);
// ALL errors are reported, including E_STRICT by default *unless* the site is in
// live mode, where reporting is limited to fatal errors and warnings (see later in this file)
error_reporting(E_ALL | E_STRICT);

/**
* Include _ss_environment.php files
Expand Down Expand Up @@ -253,13 +254,11 @@
BASE_PATH, false, isset($_GET['flush'])
));

// 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()) {
if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT | E_NOTICE));
else error_reporting(E_ALL & ~E_NOTICE);
// If in live mode, ensure deprecation, strict and notices are not reported
if(Director::isLive()) {
error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT | E_NOTICE));
}

///////////////////////////////////////////////////////////////////////////////
// POST-MANIFEST COMMANDS

Expand Down

0 comments on commit 630bfcc

Please sign in to comment.