mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 20:04:27 +02:00
- compiled templates are no longer touched with the filemtime of template source
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
11/19/2009
|
||||||
|
- compiled templates are no longer touched with the filemtime of template source
|
||||||
|
|
||||||
11/18/2009
|
11/18/2009
|
||||||
- allow integer as attribute name in plugin calls
|
- allow integer as attribute name in plugin calls
|
||||||
|
|
||||||
|
@@ -57,7 +57,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
|
|||||||
}
|
}
|
||||||
$mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name);
|
$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;
|
$must_compile = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -208,7 +208,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
|||||||
$this->isExisting(true);
|
$this->isExisting(true);
|
||||||
if ($this->mustCompile === null) {
|
if ($this->mustCompile === null) {
|
||||||
$this->mustCompile = ($this->usesCompiler() && ($this->force_compile || $this->isEvaluated() || $this->getCompiledTimestamp () === false ||
|
$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;
|
return $this->mustCompile;
|
||||||
}
|
}
|
||||||
@@ -290,12 +291,14 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
|||||||
// write compiled template
|
// write compiled template
|
||||||
Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->compiled_template, $this->smarty);
|
Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->compiled_template, $this->smarty);
|
||||||
// make template and compiled file timestamp match
|
// make template and compiled file timestamp match
|
||||||
|
/**
|
||||||
$this->compiled_timestamp = null;
|
$this->compiled_timestamp = null;
|
||||||
touch($this->getCompiledFilepath(), $this->getTemplateTimestamp());
|
touch($this->getCompiledFilepath(), $this->getTemplateTimestamp());
|
||||||
// daylight saving time problem on windows
|
// daylight saving time problem on windows
|
||||||
if ($this->template_timestamp != $this->getCompiledTimestamp()) {
|
if ($this->template_timestamp != $this->getCompiledTimestamp()) {
|
||||||
touch($this->getCompiledFilepath(), 2 * $this->template_timestamp - $this->compiled_timestamp);
|
touch($this->getCompiledFilepath(), 2 * $this->template_timestamp - $this->compiled_timestamp);
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// error compiling template
|
// error compiling template
|
||||||
@@ -442,7 +445,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
|||||||
$resource_handler = $this->loadTemplateResourceHandler($resource_type);
|
$resource_handler = $this->loadTemplateResourceHandler($resource_type);
|
||||||
$mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name);
|
$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->properties['file_dependency'] = array();
|
||||||
$this->mustCompile = true;
|
$this->mustCompile = true;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user