From 204c4cdbd79db63a3017373bee7f45a4d73b0a21 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Aug 2010 21:29:12 +0200 Subject: [PATCH] DibiConnection: fixed processing of profiler configuration --- dibi/libs/DibiConnection.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 70063899..aa2d7723 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -95,10 +95,11 @@ class DibiConnection extends DibiObject // profiler $profilerCfg = & $config['profiler']; - if (is_numeric($profilerCfg) || is_bool($profilerCfg)) { // back compatibility - $profilerCfg = array('run' => (bool) $profilerCfg); - } elseif (is_string($profilerCfg)) { - $profilerCfg = array('run' => TRUE, 'class' => $profilerCfg); + if (is_scalar($profilerCfg)) { // back compatibility + $profilerCfg = array( + 'run' => (bool) $profilerCfg, + 'class' => strlen($profilerCfg) > 1 ? $profilerCfg : NULL, + ); } if (!empty($profilerCfg['run'])) {