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
This commit is contained in:
phpnut 2007-11-12 11:51:30 +00:00
parent eb6c94a01e
commit 656ab3a9ab

View file

@ -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("<p style = \"text-align:left\"><b>Query:</b> {$sql} ");
if ($error) {
trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING);
@ -1798,7 +1796,7 @@ class DboSource extends DataSource {
*
*/
function close() {
if ($this->fullDebug && Configure::read() > 1) {
if (Configure::read() > 1) {
$this->showLog();
}
$this->disconnect();