- performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280

This commit is contained in:
uwetews
2016-09-02 01:08:50 +02:00
parent 5580857d9b
commit e1d27d68d7
13 changed files with 50 additions and 41 deletions

View File

@@ -6,15 +6,6 @@
* @subpackage PluginsFunction
*/
/**
* @ignore
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
/**
* @ignore
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
/**
* Smarty {html_select_date} plugin
* Type: function<br>
@@ -52,6 +43,12 @@ require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
*/
function smarty_function_html_select_date($params)
{
if (!is_callable('smarty_function_escape_special_chars')) {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
}
if (!is_callable('smarty_make_timestamp')) {
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
}
// generate timestamps used for month names only
static $_month_timestamps = null;
static $_current_year = null;