Index: branches/RC/core/kernel/db/db_connection.php =================================================================== diff -u -N -r9205 -r10459 --- branches/RC/core/kernel/db/db_connection.php (.../db_connection.php) (revision 9205) +++ branches/RC/core/kernel/db/db_connection.php (.../db_connection.php) (revision 10459) @@ -79,6 +79,15 @@ var $lastQuery = ''; /** + * Total processed queries count + * + * @var int + */ + var $_queryCount = 0; + +// var $_queryLog = Array (); + + /** * Initializes connection class with * db type to used in future * @@ -336,10 +345,21 @@ * @param string $key_field * @return Array */ - function Query($sql, $key_field = null) + function Query($sql, $key_field = null, $no_debug = false) { $this->lastQuery = $sql; - if ($this->debugMode) return $this->debugQuery($sql,$key_field); + $this->_queryCount++; + + /*if (!array_key_exists($sql, $this->_queryLog)) { + $this->_queryLog[$sql] = 1; + } + else { + $this->_queryLog[$sql]++; + }*/ + + if ($this->debugMode && !$no_debug) { + return $this->debugQuery($sql,$key_field); + } $query_func = $this->getMetaFunction('query'); $this->queryID = $query_func($sql,$this->connectionID); if (is_resource($this->queryID)) { @@ -404,7 +424,7 @@ // set 2nd checkpoint: begin $first_cell = count($ret) == 1 && count(current($ret)) == 1 ? current(current($ret)) : null; if ($profileSQLs) { - $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows(), $first_cell); + $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows(), $first_cell, $this->_queryCount); $debugger->profilerAddTotal('sql', 'sql_'.$queryID); } $this->Destroy(); @@ -414,7 +434,7 @@ else { // set 2nd checkpoint: begin if ($profileSQLs) { - $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows()); + $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows(), null, $this->_queryCount); $debugger->profilerAddTotal('sql', 'sql_'.$queryID); } // set 2nd checkpoint: end