added caching of requested paths to smarty_core_assemble_plugin_filepath()

This commit is contained in:
messju
2004-01-08 13:13:04 +00:00
parent 73995af1e9
commit 6950893505
2 changed files with 6 additions and 1 deletions

View File

@@ -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;
}