From 35076ee1b9e32618d3c92bdd8aee20f2c4abb694 Mon Sep 17 00:00:00 2001 From: rvelices Date: Sat, 1 Mar 2008 13:12:07 +0000 Subject: - index.tpl, menubar.tpl, mainpage_categories.tpl and month_calendar.tpl go smarty - better template debugging tweak (the smarty console is shown only once at the end) git-svn-id: http://piwigo.org/svn/trunk@2231 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/smarty/libs/Smarty.class.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'include/smarty/libs') diff --git a/include/smarty/libs/Smarty.class.php b/include/smarty/libs/Smarty.class.php index c79874606..6b893dec8 100644 --- a/include/smarty/libs/Smarty.class.php +++ b/include/smarty/libs/Smarty.class.php @@ -1057,7 +1057,7 @@ class Smarty } else { // var non-existant, return valid reference $_tmp = null; - return $_tmp; + return $_tmp; } } @@ -1116,7 +1116,7 @@ class Smarty function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false) { static $_cache_info = array(); - + $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting) ? $this->error_reporting : error_reporting() & ~E_NOTICE); @@ -1292,11 +1292,19 @@ class Smarty if ($display) { if (isset($_smarty_results)) { echo $_smarty_results; } + } + + if ($this->debugging) { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time); + } + + if ($display) { if ($this->debugging) { // capture time for debugging info $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time); require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); echo smarty_core_display_debug_console($_params, $this); } @@ -1932,10 +1940,10 @@ class Smarty { return eval($code); } - + /** * Extracts the filter name from the given callback - * + * * @param callback $function * @return string */ @@ -1950,7 +1958,7 @@ class Smarty return $function; } } - + /**#@-*/ } -- cgit v1.2.3