fixed debug timing logic for config_load

This commit is contained in:
mohrt
2003-04-21 14:22:46 +00:00
parent fa5f4bdf72
commit 97e6b40b81
2 changed files with 6 additions and 6 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- fixed debug timing logic for config_load (Tom Sommer, Monte)
- all in-code doc comments converted to phpDocumentor format (Greg) - all in-code doc comments converted to phpDocumentor format (Greg)
- moved strip from smarty core to plugin (Monte) - moved strip from smarty core to plugin (Monte)
- moved config_load from smarty core to plugin (Monte) - moved config_load from smarty core to plugin (Monte)

View File

@@ -24,6 +24,10 @@
*/ */
function smarty_function_config_load($params, &$smarty) function smarty_function_config_load($params, &$smarty)
{ {
if ($smarty->debugging) {
$_debug_start_time = $smarty->_get_microtime();
}
$_file = isset($params['file']) ? $params['file'] : null; $_file = isset($params['file']) ? $params['file'] : null;
$_section = isset($params['section']) ? $params['section'] : null; $_section = isset($params['section']) ? $params['section'] : null;
$_scope = isset($params['scope']) ? $params['scope'] : 'global'; $_scope = isset($params['scope']) ? $params['scope'] : 'global';
@@ -96,10 +100,6 @@ function smarty_function_config_load($params, &$smarty)
} }
} }
if ($smarty->debugging) {
$debug_start_time = $smarty->_get_microtime();
}
if ($smarty->caching) { if ($smarty->caching) {
$smarty->_cache_info['config'][] = $_file; $smarty->_cache_info['config'][] = $_file;
} }
@@ -118,11 +118,10 @@ function smarty_function_config_load($params, &$smarty)
} }
if ($smarty->debugging) { if ($smarty->debugging) {
$debug_start_time = $smarty->_get_microtime();
$smarty->_smarty_debug_info[] = array('type' => 'config', $smarty->_smarty_debug_info[] = array('type' => 'config',
'filename' => $_file.' ['.$_section.'] '.$_scope, 'filename' => $_file.' ['.$_section.'] '.$_scope,
'depth' => $smarty->_inclusion_depth, 'depth' => $smarty->_inclusion_depth,
'exec_time' => $smarty->_get_microtime() - $debug_start_time); 'exec_time' => $smarty->_get_microtime() - $_debug_start_time);
} }
} }