mirror of
https://github.com/Oreolek/debug-toolbar.git
synced 2024-05-19 17:38:14 +03:00
commit
8da0b9730d
|
@ -403,17 +403,17 @@ abstract class Kohana_DebugToolbar {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// Don't auto render toolbar for ajax requests
|
// 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;
|
return FALSE;
|
||||||
|
|
||||||
// Don't auto render toolbar if $_GET['debug'] = 'false'
|
// Don't auto render toolbar if $_GET['debug'] = 'false'
|
||||||
if (isset($_GET['debug']) and strtolower($_GET['debug']) == 'false')
|
if (isset($_GET['debug']) and strtolower($_GET['debug']) == 'false')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// Don't auto render if auto_render config is FALSE
|
|
||||||
if ($config->auto_render !== TRUE)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
7
init.php
7
init.php
|
@ -1,8 +1,11 @@
|
||||||
<?php defined('SYSPATH') or die('No direct script access.');
|
<?php defined('SYSPATH') or die('No direct script access.');
|
||||||
|
|
||||||
|
$config = Kohana::config('debug_toolbar');
|
||||||
|
|
||||||
// Load FirePHP if it enabled in config
|
// 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');
|
require_once Kohana::find_file('vendor', 'firephp/packages/core/lib/FirePHPCore/FirePHP.class');
|
||||||
|
|
||||||
// Render Debug Toolbar on the end of application execution
|
// Render Debug Toolbar on the end of application execution
|
||||||
register_shutdown_function('debugtoolbar::render');
|
if ($config->auto_render === TRUE)
|
||||||
|
register_shutdown_function('debugtoolbar::render');
|
Loading…
Reference in a new issue