mirror of
https://github.com/processwire/processwire.git
synced 2025-08-25 15:51:37 +02:00
Fix issue processwire/processwire-issues#316 - legacy db API variable class and debug timers in PHP7 producing unnecessary notice
This commit is contained in:
@@ -104,7 +104,7 @@ class Database extends \mysqli implements WireDatabase {
|
||||
|
||||
if($this->debug) {
|
||||
$timerKey = Debug::timer();
|
||||
if(!$timerFirstStartTime) $timerFirstStartTime = $timerKey;
|
||||
if(!$timerFirstStartTime) $timerFirstStartTime = (float) $timerKey;
|
||||
} else $timerKey = null;
|
||||
|
||||
$result = @parent::query($sql, $resultmode);
|
||||
@@ -113,9 +113,9 @@ class Database extends \mysqli implements WireDatabase {
|
||||
if($this->debug) {
|
||||
if(isset($result->num_rows)) $sql .= " [" . $result->num_rows . " rows]";
|
||||
if(!is_null($timerKey)) {
|
||||
$elapsed = Debug::timer($timerKey);
|
||||
$elapsed = (float) Debug::timer($timerKey);
|
||||
$timerTotalQueryTime += $elapsed;
|
||||
$timerTotalSinceStart = Debug::timer() - $timerFirstStartTime;
|
||||
$timerTotalSinceStart = ((float) Debug::timer()) - $timerFirstStartTime;
|
||||
$sql .= " [{$elapsed}s, {$timerTotalQueryTime}s, {$timerTotalSinceStart}s]";
|
||||
}
|
||||
$this->queryLog($sql);
|
||||
|
Reference in New Issue
Block a user