diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 14f920681..93c0e1bc5 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -266,7 +266,7 @@ class DboSource extends DataSource { $this->error = $this->lastError(); $this->numRows = $this->lastNumRows($this->_result); - if($this->fullDebug) { + if($this->fullDebug && Configure::read() > 1) { $this->logQuery($sql); } @@ -395,7 +395,7 @@ class DboSource extends DataSource { foreach($log as $k => $i) { print ("" . ($k + 1) . "{$i['query']}{$i['error']}{$i['affected']}{$i['numRows']}{$i['took']}\n"); } - print ("\n"); + print ("\n"); } else { foreach($log as $k => $i) { print (($k + 1) . ". {$i['query']} {$i['error']}\n"); @@ -432,11 +432,11 @@ class DboSource extends DataSource { */ function showQuery($sql) { $error = $this->error; - if (strlen($sql) > 200 && !$this->fullDebug) { + if (strlen($sql) > 200 && !$this->fullDebug && Configure::read() > 1) { $sql = substr($sql, 0, 200) . '[...]'; } - if ($this->debug || $error) { + if (($this->debug && Configure::read() > 0) || $error) { print ("

Query: {$sql} [Aff:{$this->affected} Num:{$this->numRows} Took:{$this->took}ms]"); if ($error) { print ("
ERROR: {$this->error}"); @@ -1544,7 +1544,7 @@ class DboSource extends DataSource { * */ function close() { - if ($this->fullDebug) { + if ($this->fullDebug && Configure::read() > 1) { $this->showLog(); } $this->disconnect(); @@ -1621,4 +1621,4 @@ class DboSource extends DataSource { } } } -?> \ No newline at end of file +?>