diff --git a/change_log.txt b/change_log.txt index 26a66964..ab4b7f53 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +14.10.2011 +- bugfix unique_resource did not properly apply to compiled resources (Forum Topic 20128) + 13.10.2011 - add caching for config files in Smarty_Resource - bugfix disable of caching after isCached() call did not work (Forum Topic 20131) diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index 2ab9410d..bc4e18bf 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -656,13 +656,9 @@ class Smarty_Template_Source { public function getCompiled(Smarty_Internal_Template $_template) { // check runtime cache - $_cache_key_dir = $_template->smarty->joined_template_dir; - $_cache_key = $_template->template_resource . '#' . $_template->compile_id; - if (!isset(Smarty_Resource::$compileds[$_cache_key_dir])) { - Smarty_Resource::$compileds[$_cache_key_dir] = array(); - } - if (isset(Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key])) { - return Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key]; + $_cache_key = $this->unique_resource . '#' . $_template->compile_id; + if (isset(Smarty_Resource::$compileds[$_cache_key])) { + return Smarty_Resource::$compileds[$_cache_key]; } $compiled = new Smarty_Template_Compiled($this); @@ -671,7 +667,7 @@ class Smarty_Template_Source { $compiled->exists = !!$compiled->timestamp; // runtime cache - Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key] = $compiled; + Smarty_Resource::$compileds[$_cache_key] = $compiled; return $compiled; }