|
19 | 19 | * Ubiquity\debug$Debugger |
20 | 20 | * This class is part of Ubiquity |
21 | 21 | * @author jc |
22 | | - * @version 1.0.1 |
| 22 | + * @version 1.0.2 |
23 | 23 | * |
24 | 24 | */ |
25 | 25 | class Debugger { |
@@ -150,7 +150,15 @@ private static function displayVar($variable){ |
150 | 150 | if(\is_object($variable)){ |
151 | 151 | return \get_class($variable).'@'.\spl_object_hash($variable); |
152 | 152 | } |
153 | | - return \var_export($variable,true); |
| 153 | + if(!self::isRecursive($variable)) { |
| 154 | + return \var_export($variable, true); |
| 155 | + } |
| 156 | + return 'Recursive array!'; |
| 157 | + } |
| 158 | + |
| 159 | + private static function isRecursive($array){ |
| 160 | + $dump = \print_r($array, true); |
| 161 | + return \strpos($dump, '*RECURSION*') !== false; |
154 | 162 | } |
155 | 163 |
|
156 | 164 |
|
@@ -221,7 +229,7 @@ private static function showTrace($trace,$index){ |
221 | 229 | $file=$trace['file']; |
222 | 230 | $attr=UString::cleanAttribute($callClass.".".$callFunction); |
223 | 231 | self::$variables[$attr]=[]; |
224 | | - if($file!=null) { |
| 232 | + if($file!=null && \file_exists($file)) { |
225 | 233 | $class = ClassUtils::getClassFullNameFromFile($file); |
226 | 234 | if ($class != null && $class != '\\' && (\class_exists($class) || \trait_exists($class))) { |
227 | 235 | $method = UIntrospection::getMethodAtLine($class, $line); |
@@ -322,7 +330,10 @@ private static function getFooter(){ |
322 | 330 | } |
323 | 331 |
|
324 | 332 | private static function getFileContent($file){ |
325 | | - return \htmlentities(\file_get_contents($file)); |
| 333 | + if(\file_exists($file)) { |
| 334 | + return \htmlentities(\file_get_contents($file)); |
| 335 | + } |
| 336 | + return "$file not found!"; |
326 | 337 | } |
327 | 338 |
|
328 | 339 | private static function loadView($name,$data){ |
|
0 commit comments