1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-24 10:53:17 +01:00

fix: DibiNettePanel is called only if required interface is available

This commit is contained in:
David Grudl 2012-01-04 18:50:23 +01:00
parent 9ba0cf62d1
commit 9be3bd7a53
2 changed files with 4 additions and 3 deletions

View File

@ -37,7 +37,6 @@ require_once dirname(__FILE__) . '/libs/DibiDatabaseInfo.php';
require_once dirname(__FILE__) . '/libs/DibiEvent.php'; require_once dirname(__FILE__) . '/libs/DibiEvent.php';
require_once dirname(__FILE__) . '/libs/DibiFileLogger.php'; require_once dirname(__FILE__) . '/libs/DibiFileLogger.php';
require_once dirname(__FILE__) . '/libs/DibiFirePhpLogger.php'; require_once dirname(__FILE__) . '/libs/DibiFirePhpLogger.php';
require_once dirname(__FILE__) . '/Nette/DibiNettePanel.php';

View File

@ -119,8 +119,10 @@ class DibiConnection extends DibiObject
$this->onEvent[] = array(new DibiFirePhpLogger($filter), 'logEvent'); $this->onEvent[] = array(new DibiFirePhpLogger($filter), 'logEvent');
} }
$panel = new DibiNettePanel(isset($profilerCfg['explain']) ? $profilerCfg['explain'] : TRUE, $filter); if (interface_exists('Nette\Diagnostics\IBarPanel') || interface_exists('IBarPanel')) {
$panel->register($this); $panel = new DibiNettePanel(isset($profilerCfg['explain']) ? $profilerCfg['explain'] : TRUE, $filter);
$panel->register($this);
}
} }
$this->substitutes = new DibiHashMap(create_function('$expr', 'return ":$expr:";')); $this->substitutes = new DibiHashMap(create_function('$expr', 'return ":$expr:";'));