From 826911d187f4690f48c93a5ef5bf973196fde6f2 Mon Sep 17 00:00:00 2001 From: MGatner Date: Tue, 10 Sep 2019 15:48:19 -0400 Subject: [PATCH 1/2] Add trace() --- system/Common.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/system/Common.php b/system/Common.php index eb88a75f0d9c..5f202f1c4ae8 100644 --- a/system/Common.php +++ b/system/Common.php @@ -1084,3 +1084,18 @@ function dd(...$vars) exit; } } + + +//-------------------------------------------------------------------- + +if (! function_exists('trace')) +{ + /** + * Provides a backtrace to the current execution point, from Kint. + */ + function trace() + { + Kint::$aliases[] = 'trace'; + Kint::trace(); + } +} From caeb1ac52060fb4d330d03061f9734b366d9a498 Mon Sep 17 00:00:00 2001 From: MGatner Date: Wed, 11 Sep 2019 13:42:09 -0400 Subject: [PATCH 2/2] Shorten trace() call to global --- user_guide_src/source/testing/debugging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index d35bd21b169a..11b78795ef10 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -42,7 +42,7 @@ This method is identical to ``d()``, except that it also ``dies()`` and no furth This provides a backtrace to the current execution point, with Kint's own unique spin:: - Kint::trace(); + trace(); For more information, see `Kint's page `_.