- bugfix unique_resource did not properly apply to compiled resources (Forum Topic 20128)

This commit is contained in:
rodneyrehm
2011-10-14 09:31:09 +00:00
parent 8471e25bd8
commit ef3e29daa7
2 changed files with 7 additions and 8 deletions

View File

@@ -1,4 +1,7 @@
===== trunk ===== ===== trunk =====
14.10.2011
- bugfix unique_resource did not properly apply to compiled resources (Forum Topic 20128)
13.10.2011 13.10.2011
- add caching for config files in Smarty_Resource - add caching for config files in Smarty_Resource
- bugfix disable of caching after isCached() call did not work (Forum Topic 20131) - bugfix disable of caching after isCached() call did not work (Forum Topic 20131)

View File

@@ -656,13 +656,9 @@ class Smarty_Template_Source {
public function getCompiled(Smarty_Internal_Template $_template) public function getCompiled(Smarty_Internal_Template $_template)
{ {
// check runtime cache // check runtime cache
$_cache_key_dir = $_template->smarty->joined_template_dir; $_cache_key = $this->unique_resource . '#' . $_template->compile_id;
$_cache_key = $_template->template_resource . '#' . $_template->compile_id; if (isset(Smarty_Resource::$compileds[$_cache_key])) {
if (!isset(Smarty_Resource::$compileds[$_cache_key_dir])) { return Smarty_Resource::$compileds[$_cache_key];
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];
} }
$compiled = new Smarty_Template_Compiled($this); $compiled = new Smarty_Template_Compiled($this);
@@ -671,7 +667,7 @@ class Smarty_Template_Source {
$compiled->exists = !!$compiled->timestamp; $compiled->exists = !!$compiled->timestamp;
// runtime cache // runtime cache
Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key] = $compiled; Smarty_Resource::$compileds[$_cache_key] = $compiled;
return $compiled; return $compiled;
} }