mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 161)
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
08.01.2014
|
||||||
|
- bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 161)
|
||||||
|
|
||||||
===== 3.1.16 =====
|
===== 3.1.16 =====
|
||||||
15.12.2013
|
15.12.2013
|
||||||
- bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161)
|
- bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161)
|
||||||
|
@@ -186,8 +186,34 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource
|
|||||||
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
||||||
{
|
{
|
||||||
$this->cache = array();
|
$this->cache = array();
|
||||||
|
$cache_name = null;
|
||||||
|
|
||||||
return $this->delete($resource_name, $cache_id, $compile_id, $exp_time);
|
if (isset($resource_name)) {
|
||||||
|
$_save_stat = $smarty->caching;
|
||||||
|
$smarty->caching = true;
|
||||||
|
$tpl = new $smarty->template_class($resource_name, $smarty);
|
||||||
|
$smarty->caching = $_save_stat;
|
||||||
|
|
||||||
|
if ($tpl->source->exists) {
|
||||||
|
$cache_name = $tpl->source->name;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// remove from template cache
|
||||||
|
if ($smarty->allow_ambiguous_resources) {
|
||||||
|
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
|
||||||
|
} else {
|
||||||
|
$_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
|
||||||
|
}
|
||||||
|
if (isset($_templateId[150])) {
|
||||||
|
$_templateId = sha1($_templateId);
|
||||||
|
}
|
||||||
|
unset($smarty->template_objects[$_templateId]);
|
||||||
|
// template object no longer needed
|
||||||
|
unset($tpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->delete($cache_name, $cache_id, $compile_id, $exp_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user