mirror of
https://github.com/Oreolek/debug-toolbar.git
synced 2024-05-06 11:08:14 +03:00
enable() and disable() methods added (implements #21)
This commit is contained in:
parent
a34fef373f
commit
ad6d6cb444
|
@ -31,6 +31,13 @@ abstract class Kohana_Debugtoolbar {
|
||||||
*/
|
*/
|
||||||
protected static $_custom_tabs = array();
|
protected static $_custom_tabs = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can we render toolbar?
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected static $_enabled = TRUE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Benchmark name
|
* Benchmark name
|
||||||
*
|
*
|
||||||
|
@ -406,6 +413,24 @@ abstract class Kohana_Debugtoolbar {
|
||||||
$firephp->fb(array($message, $table), FirePHP::TABLE);
|
$firephp->fb(array($message, $table), FirePHP::TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable toolbar
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function disable()
|
||||||
|
{
|
||||||
|
self::$_enabled = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable toolbar
|
||||||
|
* @static
|
||||||
|
*/
|
||||||
|
public static function enable()
|
||||||
|
{
|
||||||
|
self::$_enabled = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if all the conditions are correct to display the toolbar
|
* Determines if all the conditions are correct to display the toolbar
|
||||||
* (pretty kludgy, I know)
|
* (pretty kludgy, I know)
|
||||||
|
@ -415,6 +440,11 @@ abstract class Kohana_Debugtoolbar {
|
||||||
*/
|
*/
|
||||||
public static function is_enabled()
|
public static function is_enabled()
|
||||||
{
|
{
|
||||||
|
// disabled with Debugtoolbar::disable() call
|
||||||
|
if (self::$_enabled === FALSE) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
$config = Kohana::$config->load('debug_toolbar');
|
$config = Kohana::$config->load('debug_toolbar');
|
||||||
|
|
||||||
// Auto render if secret key isset
|
// Auto render if secret key isset
|
||||||
|
|
Loading…
Reference in a new issue