[TASK] Improve debugTrail() to better handle includes
authorMarkus Klein <klein.t3@mfc-linz.at>
Wed, 26 Oct 2011 00:28:04 +0000 (19:28 -0500)
committerSteffen Gebert <steffen.gebert@typo3.org>
Fri, 27 Jan 2012 20:26:25 +0000 (21:26 +0100)
The deprecation log lacks specific and necessary information about
include and require calls, which makes it hard to actually follow
a stack trace.

Add special treatment of this sort of functions and display additional
path information.

Change-Id: I0510082ad8668b0d552f65969bbec95f37365770
Resolves: #31300
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7795
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
t3lib/utility/class.t3lib_utility_debug.php

index 3b858e0..2e761a8 100644 (file)
@@ -227,7 +227,12 @@ final class t3lib_utility_Debug {
 
                $path = array();
                foreach ($trail as $dat) {
-                       $path[] = $dat['class'] . $dat['type'] . $dat['function'] . '#' . $dat['line'];
+                       $pathFragment = $dat['class'] . $dat['type'] . $dat['function'];
+                               // add the path of the included file
+                       if (in_array($dat['function'], array('require', 'include', 'require_once', 'include_once'))) {
+                               $pathFragment .= '(' . substr($dat['args'][0], strlen(PATH_site)) . '),' . substr($dat['file'], strlen(PATH_site));
+                       }
+                       $path[] = $pathFragment . '#' . $dat['line'];
                }
 
                return implode(' // ', $path);