[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:27:15 +0000 (21:27 +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: If44397c4e6672932f95d3854105a20993fbdf9d9
Resolves: #31300
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7794
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
t3lib/utility/class.t3lib_utility_debug.php

index d819f66..35fefe8 100644 (file)
@@ -225,7 +225,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);