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
This commit is contained in:
parent
96f428f83c
commit
c1bcfec3d2
|
@ -27,7 +27,7 @@ public static function render($response)
|
||||||
// We only want to send the profiler toolbar if the request is not an AJAX
|
// 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
|
// request, as sending it on AJAX requests could mess up JSON driven API
|
||||||
// type applications, so we will not send anything in those scenarios.
|
// 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'] = get_file_size(memory_get_usage(true));
|
||||||
static::$data['memory_peak'] = get_file_size(memory_get_peak_usage(true));
|
static::$data['memory_peak'] = get_file_size(memory_get_peak_usage(true));
|
||||||
|
|
Loading…
Reference in New Issue