Minor PHP5.4 fixes

Explictly excludes E_STRICT from live error level and handle arrays in a backtrace
output, rather than trying to convert to string.
This commit is contained in:
Simon Welsh 2012-10-16 23:37:30 +13:00
parent 392543bde3
commit 4ff8cff262
2 changed files with 6 additions and 4 deletions

View File

@ -240,8 +240,8 @@ if(isset($_GET['debugmanifest'])) Debug::show(file_get_contents(MANIFEST_FILE));
// 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_NOTICE) ^ E_DEPRECATED);
else error_reporting(E_ALL ^ E_NOTICE);
if(defined('E_DEPRECATED')) error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT));
else error_reporting(E_ALL & ~E_NOTICE);
}
///////////////////////////////////////////////////////////////////////////////
// POST-MANIFEST COMMANDS

View File

@ -130,7 +130,9 @@ class SS_Backtrace {
if($showArgs && isset($item['args'])) {
$args = array();
foreach($item['args'] as $arg) {
if(!is_object($arg) || method_exists($arg, '__toString')) {
if(is_array($arg)) {
$args[] = 'Array';
} elseif(!is_object($arg) || method_exists($arg, '__toString')) {
$args[] = (string) $arg;
} else {
$args[] = get_class($arg);
@ -175,4 +177,4 @@ class SS_Backtrace {
return $result;
}
}
}