From c1bcfec3d2da1c6ef27b3de685228622ef21aa51 Mon Sep 17 00:00:00 2001 From: kapil verma Date: Thu, 6 Sep 2012 04:42:58 +0530 Subject: [PATCH] Turn profiler off using runtime Config just added a check in Profiler's render method to also look at Config::get('application.profiler') as laravel allows changing config during runtime. This allows turning off profiler for certain actions --- laravel/profiling/profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index 01469ab8..360e4702 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -27,7 +27,7 @@ class Profiler { // We only want to send the profiler toolbar if the request is not an AJAX // request, as sending it on AJAX requests could mess up JSON driven API // type applications, so we will not send anything in those scenarios. - if ( ! Request::ajax()) + if ( ! Request::ajax() and Config::get('application.profiler') ) { static::$data['memory'] = get_file_size(memory_get_usage(true)); static::$data['memory_peak'] = get_file_size(memory_get_peak_usage(true));