From 826a0ceb950872bb311addd24c1a8da76a1cccc6 Mon Sep 17 00:00:00 2001 From: wei <> Date: Mon, 19 Feb 2007 02:23:19 +0000 Subject: Add trace to active records and TDbCommand --- framework/Data/TDbCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'framework/Data/TDbCommand.php') diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php index 9cf5b0a0..102bdf34 100644 --- a/framework/Data/TDbCommand.php +++ b/framework/Data/TDbCommand.php @@ -180,6 +180,7 @@ class TDbCommand extends TComponent { try { + Prado::trace('Execute Command: '.$this->getDebugStatementText(), 'System.Data'); if($this->_statement instanceof PDOStatement) { $this->_statement->execute(); @@ -197,7 +198,7 @@ class TDbCommand extends TComponent /** * @return String prepared SQL text for debugging purposes. */ - protected function getDebugStatementText() + public function getDebugStatementText() { if(Prado::getApplication()->getMode() === TApplicationMode::Debug) return $this->_statement instanceof PDOStatement ? @@ -215,6 +216,7 @@ class TDbCommand extends TComponent { try { + Prado::trace('Query: '.$this->getDebugStatementText(), 'System.Data'); if($this->_statement instanceof PDOStatement) $this->_statement->execute(); else @@ -239,6 +241,7 @@ class TDbCommand extends TComponent { try { + Prado::trace('Query Row: '.$this->getDebugStatementText(), 'System.Data'); if($this->_statement instanceof PDOStatement) $this->_statement->execute(); else @@ -264,6 +267,7 @@ class TDbCommand extends TComponent { try { + Prado::trace('Query Scalar: '.$this->getDebugStatementText(), 'System.Data'); if($this->_statement instanceof PDOStatement) $this->_statement->execute(); else -- cgit v1.2.3