- 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 =====
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)

View File

@@ -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;
}