From cc4058c633167be3254bcf697a959348dbcbc75b Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Thu, 19 Nov 2009 14:45:04 +0000 Subject: [PATCH] - compiled templates are no longer touched with the filemtime of template source --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_compile_include.php | 3 ++- libs/sysplugins/smarty_internal_template.php | 10 +++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index c19d6cbf..688707ff 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +11/19/2009 +- compiled templates are no longer touched with the filemtime of template source + 11/18/2009 - allow integer as attribute name in plugin calls diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index 56198e42..baa73402 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -57,7 +57,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { } $mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name); } - If ($mtime != $_file_to_check[1]) { +// If ($mtime != $_file_to_check[1]) { + If ($mtime > $_file_to_check[1]) { $must_compile = true; break; } diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 84f9b4d8..75a3c3f1 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -208,7 +208,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $this->isExisting(true); if ($this->mustCompile === null) { $this->mustCompile = ($this->usesCompiler() && ($this->force_compile || $this->isEvaluated() || $this->getCompiledTimestamp () === false || - ($this->smarty->compile_check && $this->getCompiledTimestamp () !== $this->getTemplateTimestamp ()))); +// ($this->smarty->compile_check && $this->getCompiledTimestamp () !== $this->getTemplateTimestamp ()))); + ($this->smarty->compile_check && $this->getCompiledTimestamp () < $this->getTemplateTimestamp ()))); } return $this->mustCompile; } @@ -290,12 +291,14 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { // write compiled template Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->compiled_template, $this->smarty); // make template and compiled file timestamp match +/** $this->compiled_timestamp = null; touch($this->getCompiledFilepath(), $this->getTemplateTimestamp()); // daylight saving time problem on windows if ($this->template_timestamp != $this->getCompiledTimestamp()) { touch($this->getCompiledFilepath(), 2 * $this->template_timestamp - $this->compiled_timestamp); - } + } +**/ } } else { // error compiling template @@ -442,7 +445,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $resource_handler = $this->loadTemplateResourceHandler($resource_type); $mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name); } - If ($mtime != $_file_to_check[1]) { +// If ($mtime != $_file_to_check[1]) { + If ($mtime > $_file_to_check[1]) { $this->properties['file_dependency'] = array(); $this->mustCompile = true; break;