From c6f6f82f24d65585cf331a6e679a8182043d58fa Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 17 Oct 2008 00:52:58 +0000 Subject: [PATCH] FEATURE: Added ?debug_memory=1 flag git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64473 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/Director.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/control/Director.php b/core/control/Director.php index b6df9c80e..59dea7013 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -121,11 +121,15 @@ class Director { $response = new HTTPResponse(); $response->setBody($result); } - - $response->output(); + + // ?debug_memory=1 will output the number of bytes of memory used for this request + if(isset($_REQUEST['debug_memory']) && $_REQUEST['debug_memory']) { + echo number_format(memory_get_peak_usage(),0); + } else { + $response->output(); + } //$controllerObj->getSession()->inst_save(); - } }