diff --git a/NEWS b/NEWS index 5187120f..f4a30653 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - add caching of requested paths to _assemble_plugin_filepath() (messju) - fix handling of comments inside {php}- and {literal}-blocks (messju) - fix bug handling triple-quotes in config-files (BRDude, messju) - change default of request_use_auto_globals to true - $_SERVER is diff --git a/libs/core/core.assemble_plugin_filepath.php b/libs/core/core.assemble_plugin_filepath.php index ec44f8e4..c0d9d866 100644 --- a/libs/core/core.assemble_plugin_filepath.php +++ b/libs/core/core.assemble_plugin_filepath.php @@ -14,8 +14,12 @@ */ function smarty_core_assemble_plugin_filepath($params, &$smarty) { + static $_filepaths_cache = array(); $_plugin_filename = $params['type'] . '.' . $params['name'] . '.php'; + if (isset($_filepaths_cache[$_plugin_filename])) { + return $_filepaths_cache[$_plugin_filename]; + } $_return = false; foreach ((array)$smarty->plugins_dir as $_plugin_dir) { @@ -53,7 +57,7 @@ function smarty_core_assemble_plugin_filepath($params, &$smarty) } } } - + $_filepaths_cache[$_plugin_filename] = $_return; return $_return; }