- performance store flag for already required shared plugin functions in static variable or

Smarty's $_cache to improve performance when plugins are often called
    51e0d5cd40 (commitcomment-22280086)
This commit is contained in:
uwetews
2017-05-27 11:04:00 +02:00
parent a49a08748f
commit e51b0ac4af
13 changed files with 126 additions and 45 deletions

View File

@@ -28,15 +28,18 @@
* @author Monte Ohrt <monte at ohrt dot com>
* @author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>
*
* @param array $params parameters
* @param array $params parameters
*
* @param \Smarty_Internal_Template $template
*
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_options($params)
function smarty_function_html_options($params, Smarty_Internal_Template $template)
{
if (!is_callable('smarty_function_escape_special_chars')) {
if (!isset($template->smarty->_cache[ '_required_sesc' ])) {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
$template->smarty->_cache[ '_required_sesc' ] = true;
}
$name = null;