From 656ab3a9ab2c6bf9b94a10647ffdd788951ab9cf Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 12 Nov 2007 11:51:30 +0000 Subject: [PATCH] Closes #3530, SQL log not shown when enabling debugging only for certain actions git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5988 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 369479726..ea2808207 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -88,8 +88,6 @@ class DboSource extends DataSource { * Constructor */ function __construct($config = null, $autoConnect = true) { - $this->debug = Configure::read() > 0; - $this->fullDebug = Configure::read() > 1; parent::__construct($config); if ($autoConnect) { @@ -158,7 +156,7 @@ class DboSource extends DataSource { $this->error = $this->lastError(); $this->numRows = $this->lastNumRows($this->_result); - if ($this->fullDebug && Configure::read() > 1) { + if (Configure::read() > 1) { $this->logQuery($sql); } @@ -430,11 +428,11 @@ class DboSource extends DataSource { */ function showQuery($sql) { $error = $this->error; - if (strlen($sql) > 200 && !$this->fullDebug && Configure::read() > 1) { + if (strlen($sql) > 200 && Configure::read() > 1) { $sql = substr($sql, 0, 200) . '[...]'; } - if (($this->debug || $error) && Configure::read() > 0) { + if (($error) && Configure::read() > 0) { e("

Query: {$sql} "); if ($error) { trigger_error("SQL Error: {$this->error}", E_USER_WARNING); @@ -1436,7 +1434,7 @@ class DboSource extends DataSource { } else { $fields = array_filter($fields); } - + if (!$quote) { return $fields; } @@ -1798,7 +1796,7 @@ class DboSource extends DataSource { * */ function close() { - if ($this->fullDebug && Configure::read() > 1) { + if (Configure::read() > 1) { $this->showLog(); } $this->disconnect(); @@ -2030,4 +2028,4 @@ class DboSource extends DataSource { return false; } } -?> \ No newline at end of file +?>