mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
* fixed plugin filepath cache must not be static, because of possible problem
when using multiple Smarty instances with diffrent plugins_dir settings https://github.com/smarty-php/smarty/issues/146
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2015-12-30 Uwe Tews
|
||||
|
||||
* fixed plugin filepath cache must not be static, because of possible problem
|
||||
when using multiple Smarty instances with diffrent plugins_dir settings
|
||||
https://github.com/smarty-php/smarty/issues/146
|
||||
|
||||
2015-06-21 Uwe Tews
|
||||
|
||||
* PHP7 raises E_DEPRECATED use __construct for compatibility
|
||||
|
@@ -562,6 +562,12 @@ class Smarty
|
||||
*/
|
||||
var $_cache_including = false;
|
||||
|
||||
/**
|
||||
* plugin filepath cache
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $_filepaths_cache = array();
|
||||
/**#@-*/
|
||||
/**
|
||||
* The class constructor.
|
||||
|
@@ -14,11 +14,9 @@
|
||||
*/
|
||||
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];
|
||||
if (isset($smarty->_filepaths_cache[$_plugin_filename])) {
|
||||
return $smarty->_filepaths_cache[$_plugin_filename];
|
||||
}
|
||||
$_return = false;
|
||||
|
||||
@@ -58,7 +56,7 @@ function smarty_core_assemble_plugin_filepath($params, &$smarty)
|
||||
}
|
||||
}
|
||||
}
|
||||
$_filepaths_cache[$_plugin_filename] = $_return;
|
||||
$smarty->_filepaths_cache[$_plugin_filename] = $_return;
|
||||
return $_return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user