mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
added caching of requested paths to smarty_core_assemble_plugin_filepath()
This commit is contained in:
1
NEWS
1
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 handling of comments inside {php}- and {literal}-blocks (messju)
|
||||||
- fix bug handling triple-quotes in config-files (BRDude, messju)
|
- fix bug handling triple-quotes in config-files (BRDude, messju)
|
||||||
- change default of request_use_auto_globals to true - $_SERVER is
|
- change default of request_use_auto_globals to true - $_SERVER is
|
||||||
|
@@ -14,8 +14,12 @@
|
|||||||
*/
|
*/
|
||||||
function smarty_core_assemble_plugin_filepath($params, &$smarty)
|
function smarty_core_assemble_plugin_filepath($params, &$smarty)
|
||||||
{
|
{
|
||||||
|
static $_filepaths_cache = array();
|
||||||
|
|
||||||
$_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
|
$_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
|
||||||
|
if (isset($_filepaths_cache[$_plugin_filename])) {
|
||||||
|
return $_filepaths_cache[$_plugin_filename];
|
||||||
|
}
|
||||||
$_return = false;
|
$_return = false;
|
||||||
|
|
||||||
foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
|
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;
|
return $_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user