Permalink
Browse files

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.
  • Loading branch information...
simonwelsh committed Oct 16, 2012
1 parent 392543b commit 4ff8cff262077e2ff1f32172cc471f829110834c
Showing with 6 additions and 4 deletions.
  1. +2 −2 core/Core.php
  2. +4 −2 dev/Backtrace.php
View
@@ -240,8 +240,8 @@ function sapphire_autoload($className) {
// 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
@@ -130,7 +130,9 @@ static function full_func_name($item, $showArgs = false) {
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 @@ static function get_rendered_backtrace($bt, $plainText = false, $ignoredFunction
return $result;
}
-}
+}

0 comments on commit 4ff8cff

Please sign in to comment.