1
0
Fork 0
mirror of https://github.com/Oreolek/debug-toolbar.git synced 2024-04-26 22:29:19 +03:00

Merge pull request #19 from smgladkovskiy/3.1

Changes for 3.1 branch
This commit is contained in:
Ivan Brotkin 2013-01-21 21:46:52 -08:00
commit 8da0b9730d
2 changed files with 10 additions and 7 deletions

View file

@ -403,17 +403,17 @@ abstract class Kohana_DebugToolbar {
return FALSE;
// Don't auto render toolbar for ajax requests
if (Request::initial()->is_ajax())
if (Request::initial() AND Request::initial()->is_ajax())
return FALSE;
// Don't auto render toolbar for cli requests
if (Kohana::$is_cli)
return FALSE;
// Don't auto render toolbar if $_GET['debug'] = 'false'
if (isset($_GET['debug']) and strtolower($_GET['debug']) == 'false')
return FALSE;
// Don't auto render if auto_render config is FALSE
if ($config->auto_render !== TRUE)
return FALSE;
return TRUE;
}
}

View file

@ -1,8 +1,11 @@
<?php defined('SYSPATH') or die('No direct script access.');
$config = Kohana::config('debug_toolbar');
// Load FirePHP if it enabled in config
if(Kohana::config('debug_toolbar.firephp_enabled') === TRUE)
if($config->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');
if ($config->auto_render === TRUE)
register_shutdown_function('debugtoolbar::render');