From 9be3bd7a539394efdfeaaadfbaae9b0b14a34bfb Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 4 Jan 2012 18:50:23 +0100 Subject: [PATCH 1/2] fix: DibiNettePanel is called only if required interface is available --- dibi/dibi.php | 1 - dibi/libs/DibiConnection.php | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dibi/dibi.php b/dibi/dibi.php index 969a0511..a767bf65 100644 --- a/dibi/dibi.php +++ b/dibi/dibi.php @@ -37,7 +37,6 @@ require_once dirname(__FILE__) . '/libs/DibiDatabaseInfo.php'; require_once dirname(__FILE__) . '/libs/DibiEvent.php'; require_once dirname(__FILE__) . '/libs/DibiFileLogger.php'; require_once dirname(__FILE__) . '/libs/DibiFirePhpLogger.php'; -require_once dirname(__FILE__) . '/Nette/DibiNettePanel.php'; diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 80ae4751..1e3778f1 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -119,8 +119,10 @@ class DibiConnection extends DibiObject $this->onEvent[] = array(new DibiFirePhpLogger($filter), 'logEvent'); } - $panel = new DibiNettePanel(isset($profilerCfg['explain']) ? $profilerCfg['explain'] : TRUE, $filter); - $panel->register($this); + if (interface_exists('Nette\Diagnostics\IBarPanel') || interface_exists('IBarPanel')) { + $panel = new DibiNettePanel(isset($profilerCfg['explain']) ? $profilerCfg['explain'] : TRUE, $filter); + $panel->register($this); + } } $this->substitutes = new DibiHashMap(create_function('$expr', 'return ":$expr:";')); From 1d63af75f96149e031fe3f538009a852bf2391e7 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 6 Jan 2012 04:02:23 +0100 Subject: [PATCH 2/2] Nette: getContainer() renamed to getContainerBuilder() --- dibi/Nette/DibiNetteExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dibi/Nette/DibiNetteExtension.php b/dibi/Nette/DibiNetteExtension.php index a19f5803..90721065 100644 --- a/dibi/Nette/DibiNetteExtension.php +++ b/dibi/Nette/DibiNetteExtension.php @@ -23,7 +23,7 @@ class DibiNetteExtension extends Nette\Config\CompilerExtension public function loadConfiguration() { - $container = $this->getContainer(); + $container = $this->getContainerBuilder(); $config = $this->getConfig(); $useProfiler = isset($config['profiler'])