Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/db/db_connection.php
Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Line(s) | |||||
// set 1st checkpoint: begin | // set 1st checkpoint: begin | ||||
$start_time = $this->_captureStatistics ? microtime(true) : 0; | $start_time = $this->_captureStatistics ? microtime(true) : 0; | ||||
// set 1st checkpoint: end | // set 1st checkpoint: end | ||||
$this->setError(0, ''); // reset error | $this->setError(0, ''); // reset error | ||||
$this->queryID = $this->connectionID->query($sql); | $this->queryID = $this->connectionID->query($sql); | ||||
if ( is_object($this->queryID) ) { | if ( is_object($this->queryID) ) { | ||||
/** @var kMySQLQuery $ret */ | |||||
$ret = new $iterator_class($this->queryID, $key_field); | $ret = new $iterator_class($this->queryID, $key_field); | ||||
/* @var $ret kMySQLQuery */ | |||||
// set 2nd checkpoint: begin | // set 2nd checkpoint: begin | ||||
if ( $this->_captureStatistics ) { | if ( $this->_captureStatistics ) { | ||||
$query_time = microtime(true) - $start_time; | $query_time = microtime(true) - $start_time; | ||||
if ( $query_time > DBG_MAX_SQL_TIME ) { | if ( $query_time > DBG_MAX_SQL_TIME ) { | ||||
$this->Application->logSlowQuery($sql, $query_time); | $this->Application->logSlowQuery($sql, $query_time); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 476 Lines • ▼ Show 20 Line(s) | |||||
$debugger->profileStart('sql_' . $queryID, $debugger->formatSQL($sql)); | $debugger->profileStart('sql_' . $queryID, $debugger->formatSQL($sql)); | ||||
} | } | ||||
// set 1st checkpoint: end | // set 1st checkpoint: end | ||||
$this->setError(0, ''); // reset error | $this->setError(0, ''); // reset error | ||||
$this->queryID = $this->connectionID->query($sql); | $this->queryID = $this->connectionID->query($sql); | ||||
if ( is_object($this->queryID) ) { | if ( is_object($this->queryID) ) { | ||||
/** @var kMySQLQuery $ret */ | |||||
$ret = new $iterator_class($this->queryID, $key_field); | $ret = new $iterator_class($this->queryID, $key_field); | ||||
/* @var $ret kMySQLQuery */ | |||||
// set 2nd checkpoint: begin | // set 2nd checkpoint: begin | ||||
if ( $this->_profileSQLs ) { | if ( $this->_profileSQLs ) { | ||||
$current_row = $ret->current(); | $current_row = $ret->current(); | ||||
if ( count($ret) == 1 && $ret->fieldCount() == 1 ) { | if ( count($ret) == 1 && $ret->fieldCount() == 1 ) { | ||||
if ( is_array($current_row) ) { | if ( is_array($current_row) ) { | ||||
$first_cell = current($current_row); | $first_cell = current($current_row); | ||||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |