diff options
author | rvelices <rv-github@modusoptimus.com> | 2009-02-04 02:30:48 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2009-02-04 02:30:48 +0000 |
commit | 06bccdfcc344d25aca27e59250dd93ba95929974 (patch) | |
tree | 769ac1fa6ee5e564cd0abb745a2d94643155ba5e /include/smarty/libs | |
parent | 5c001820a1ef870405542750ee61fefc9c1aa747 (diff) |
optimizations (php only)
- removed unnecessary call to array_unique in get_image_ids_for_tags
- put back in smarty exec time counting (debug mode) for each included template
- prefix some smarty modifiers with @ in some templates
- do not call format_date (still very slow due to mktime and date even after prev commit) from category_default.inc.php - if used in templates format_date can be used as a smarty modifier
git-svn-id: http://piwigo.org/svn/trunk@3120 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/smarty/libs/Smarty.class.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/smarty/libs/Smarty.class.php b/include/smarty/libs/Smarty.class.php index 95ec67bab..8e56346f9 100644 --- a/include/smarty/libs/Smarty.class.php +++ b/include/smarty/libs/Smarty.class.php @@ -20,7 +20,7 @@ * * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to - * smarty-discussion-subscribe@googlegroups.com + * smarty-discussion-subscribe@googlegroups.com * * @link http://www.smarty.net/ * @copyright 2001-2005 New Digital Group, Inc. @@ -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); @@ -1303,6 +1303,12 @@ class Smarty error_reporting($_smarty_old_error_level); return; } else { + 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); + } error_reporting($_smarty_old_error_level); if (isset($_smarty_results)) { return $_smarty_results; } } @@ -1932,10 +1938,10 @@ class Smarty { return eval($code); } - + /** * Extracts the filter name from the given callback - * + * * @param callback $function * @return string */ @@ -1950,7 +1956,7 @@ class Smarty return $function; } } - + /**#@-*/ } |