mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-01 21:01:37 +01:00
added caching of requested paths to smarty_core_assemble_plugin_filepath()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user