From e6fb886260135ebe54bcda903537dd06dd43d281 Mon Sep 17 00:00:00 2001 From: smgladkovskiy Date: Thu, 8 Sep 2011 00:16:48 +0400 Subject: [PATCH] autorender fix (#17) --- classes/kohana/debugtoolbar.php | 8 ++++---- init.php | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/classes/kohana/debugtoolbar.php b/classes/kohana/debugtoolbar.php index 38c54e0..6e4356a 100644 --- a/classes/kohana/debugtoolbar.php +++ b/classes/kohana/debugtoolbar.php @@ -406,12 +406,12 @@ abstract class Kohana_DebugToolbar { if (Request::initial() AND Request::initial()->is_ajax()) return FALSE; - // Don't auto render toolbar if $_GET['debug'] = 'false' - if (isset($_GET['debug']) and strtolower($_GET['debug']) == 'false') + // Don't auto render toolbar for cli requests + if (Kohana::$is_cli) return FALSE; - // Don't auto render if auto_render config is FALSE - if ($config->auto_render !== TRUE) + // Don't auto render toolbar if $_GET['debug'] = 'false' + if (isset($_GET['debug']) and strtolower($_GET['debug']) == 'false') return FALSE; return TRUE; diff --git a/init.php b/init.php index 6a5a0a4..119bfd1 100644 --- a/init.php +++ b/init.php @@ -1,8 +1,11 @@ firephp_enabled === TRUE) require_once Kohana::find_file('vendor', 'firephp/packages/core/lib/FirePHPCore/FirePHP.class'); // Render Debug Toolbar on the end of application execution -register_shutdown_function('debugtoolbar::render'); \ No newline at end of file +if ($config->auto_render === TRUE) + register_shutdown_function('debugtoolbar::render'); \ No newline at end of file