From c455a71afa2c6bf242571941b0263e1ec72d3d96 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 30 Nov 2007 13:47:12 -0500 Subject: [PATCH] Fixing some warnings that I discovered through unit testing under E_ALL * Functions.php: (BSFunctions::FetchMicrotimeDiff): Refactored the local vars * Template.php: (BSTemplate::fetch): Fixed a warning generated by the uncached template counter (BSTemplate::flush): Fixed a warning about the microtime diff because we weren't passing a microtime, just the seconds --- Functions.php | 6 +++--- Template.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Functions.php b/Functions.php index 97ff605..8914ead 100644 --- a/Functions.php +++ b/Functions.php @@ -469,9 +469,9 @@ class BSFunctions public static function FetchMicrotimeDiff($mtstart) { $mtend = microtime(); - list ($starttime['micro'], $starttime['sec']) = explode(' ', $mtstart); - list ($endtime['micro'], $endtime['sec']) = explode(' ', $mtend); - return ($endtime['micro'] + $endtime['sec']) - ($starttime['micro'] + $starttime['sec']); + list($startMicro, $startSec) = explode(' ', $mtstart); + list($endMicro, $endSec) = explode(' ', $mtend); + return ($endMicro + $endSec) - ($startMicro + $startSec); } // ################################################################### diff --git a/Template.php b/Template.php index 880e97c..552df5c 100644 --- a/Template.php +++ b/Template.php @@ -218,7 +218,7 @@ class BSTemplate } else { - $this->uncached[$name]++; + $this->uncached[$name] = (isset($this->uncached[$name]) ? $this->uncached[$name] + 1 : 0); BSApp::Debug("Manually loading template '$name'"); $template = $this->_loadTemplate($name); $template = $this->_parseTemplate($template); @@ -250,7 +250,7 @@ class BSTemplate $debugBlock = ''; if (BSApp::GetDebug()) { - $debugBlock .= "\n
Executed in " . round(BSFunctions::FetchMicrotimeDiff($_SERVER['REQUEST_TIME']), 10) . ' seconds
'; + $debugBlock .= "\n
Executed in " . round(BSFunctions::FetchMicrotimeDiff('0 ' . $_SERVER['REQUEST_TIME']), 10) . ' seconds
'; $debugBlock .= "\n
" . BSApp::GetDebugList() . "
"; if (sizeof($this->uncached) > 0) -- 2.22.5