diff --git a/NEWS b/NEWS index d74d932b..1d78ca95 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fixed debug timing logic for config_load (Tom Sommer, Monte) - all in-code doc comments converted to phpDocumentor format (Greg) - moved strip from smarty core to plugin (Monte) - moved config_load from smarty core to plugin (Monte) diff --git a/libs/plugins/function.config_load.php b/libs/plugins/function.config_load.php index 3e3a5f5b..60d3168b 100644 --- a/libs/plugins/function.config_load.php +++ b/libs/plugins/function.config_load.php @@ -24,6 +24,10 @@ */ function smarty_function_config_load($params, &$smarty) { + if ($smarty->debugging) { + $_debug_start_time = $smarty->_get_microtime(); + } + $_file = isset($params['file']) ? $params['file'] : null; $_section = isset($params['section']) ? $params['section'] : null; $_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) { $smarty->_cache_info['config'][] = $_file; } @@ -118,11 +118,10 @@ function smarty_function_config_load($params, &$smarty) } if ($smarty->debugging) { - $debug_start_time = $smarty->_get_microtime(); $smarty->_smarty_debug_info[] = array('type' => 'config', 'filename' => $_file.' ['.$_section.'] '.$_scope, 'depth' => $smarty->_inclusion_depth, - 'exec_time' => $smarty->_get_microtime() - $debug_start_time); + 'exec_time' => $smarty->_get_microtime() - $_debug_start_time); } }