- improvement removed unnecessary sha1()

(and added previously forgotten templates for ClearCompileTests)
This commit is contained in:
rodneyrehm
2011-10-20 20:28:21 +00:00
parent 922017c7fa
commit 6470e6a2c9
6 changed files with 7 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
- @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it.
- bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true.
- bugfix {html_select_date} and {html_select_time} did not properly handle empty time arguments (Forum Topic 20190)
- improvement removed unnecessary sha1()
19.10.2011
- revert PHP4 constructor message

View File

@@ -1173,7 +1173,7 @@ class Smarty extends Smarty_Internal_TemplateBase {
$compile_id = $compile_id === null ? $this->compile_id : $compile_id;
// already in template cache?
$unique_template_name = Smarty_Resource::getUniqueTemplateName($this, $template);
$_templateId = sha1($unique_template_name . $cache_id . $compile_id);
$_templateId = $unique_template_name . $cache_id . $compile_id;
if ($do_clone) {
if (isset($this->template_objects[$_templateId])) {
// return cached template object

View File

@@ -178,7 +178,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource {
}
// remove from template cache
$_templateId = sha1($tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id);
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
unset($smarty->template_objects[$_templateId]);
}
return $uid;

View File

@@ -154,7 +154,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
// remove from template cache
$tpl->source; // have the template registered before unset()
$_templateId = sha1($tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id);
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
unset($smarty->template_objects[$_templateId]);
if ($tpl->source->exists) {

View File

@@ -246,7 +246,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
{
// already in template cache?
$unique_template_name = Smarty_Resource::getUniqueTemplateName($this->smarty, $template);
$_templateId = sha1($unique_template_name . $cache_id . $compile_id);
$_templateId = $unique_template_name . $cache_id . $compile_id;
if (isset($this->smarty->template_objects[$_templateId])) {
// clone cached template object because of possible recursive call
$tpl = clone $this->smarty->template_objects[$_templateId];
@@ -620,7 +620,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
// cache template object under a unique ID
// do not cache eval resources
if ($this->source->type != 'eval') {
$_templateId = sha1($this->source->unique_resource . $this->cache_id . $this->compile_id);
$_templateId = $this->source->unique_resource . $this->cache_id . $this->compile_id;
$this->smarty->template_objects[$_templateId] = $this;
}
return $this->source;

View File

@@ -192,7 +192,7 @@ class Smarty_Internal_Utility {
// remove from template cache
$tpl->source; // have the template registered before unset()
$_templateId = sha1($tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id);
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
unset($smarty->template_objects[$_templateId]);
if ($tpl->source->exists) {