From b6daee1f526bd1cd9cb661304f156cbf0dc24c64 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 5 Mar 2018 15:45:57 +0100 Subject: [inc/Util] Print profiling info to error_log on redirect --- inc/util.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc') diff --git a/inc/util.inc.php b/inc/util.inc.php index 69eaf941..c0617310 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -179,6 +179,13 @@ SADFACE; $location .= '&' . implode('&', self::$redirectParams); } } + if (CONFIG_DEBUG) { + global $global_start; + $duration = microtime(true) - $global_start; + error_log('Redirect: ' . round($duration, 3) . 's, ' + . Database::getQueryCount() . ' queries, ' + . round(Database::getQueryTime(), 3) . 's query time total'); + } Header('Location: ' . $location); exit(0); } -- cgit v1.2.3-55-g7522