From 26a3c1cf4a722ff1d8fc41dadb91ef8e238cdb3b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 15 Nov 2012 14:56:43 +1300 Subject: [PATCH] Re-adding Debug::caller() which was inadvertently removed in 9eca2d6 --- dev/Debug.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dev/Debug.php b/dev/Debug.php index 58b7331d8..b1957966d 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -82,7 +82,17 @@ class Debug { } } - + + public static function caller() { + $bt = debug_backtrace(); + $caller = $bt[2]; + $caller['line'] = $bt[1]['line']; + $caller['file'] = $bt[1]['file']; + if(!isset($caller['class'])) $caller['class'] = ''; + if(!isset($caller['type'])) $caller['type'] = ''; + return $caller; + } + /** * Close out the show dumper *