- fixed bug in caching mode 2 and cache_lifetime -1

This commit is contained in:
Uwe.Tews
2009-10-19 18:32:35 +00:00
parent 88229447d1
commit 7189a3db28
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
10/19/2009 10/19/2009
- fixed bug in caching mode 2 and cache_lifetime -1
- fixed modifier support on block tags - fixed modifier support on block tags
10/17/2009 10/17/2009

View File

@@ -43,6 +43,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
public $compile_time = 0; public $compile_time = 0;
public $mustCompile = null; public $mustCompile = null;
public $suppressHeader = false; public $suppressHeader = false;
public $suppressFileDependency = false;
public $extract_code = false; public $extract_code = false;
public $extracted_compiled_code = ''; public $extracted_compiled_code = '';
// Rendered content // Rendered content
@@ -146,7 +147,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
{ {
if ($this->template_source === null) { if ($this->template_source === null) {
if (!$this->smarty->resource_objects[$this->resource_type]->getTemplateSource($this)) { if (!$this->smarty->resource_objects[$this->resource_type]->getTemplateSource($this)) {
throw new Exception("Unable to read template '{$this->resource_name}'"); throw new Exception("Unable to read template {$this->resource_type} '{$this->resource_name}'");
} }
} }
return $this->template_source; return $this->template_source;
@@ -165,7 +166,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
$this->isExisting = $this->smarty->resource_objects[$this->resource_type]->isExisting($this); $this->isExisting = $this->smarty->resource_objects[$this->resource_type]->isExisting($this);
} }
if (!$this->isExisting && $error) { if (!$this->isExisting && $error) {
throw new Exception("Unable to load template \"{$this->resource_type} : {$this->resource_name}\""); throw new Exception("Unable to load template {$this->resource_type} '{$this->resource_name}'");
} }
return $this->isExisting; return $this->isExisting;
} }
@@ -377,7 +378,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
$_start_time = $this->_get_time(); $_start_time = $this->_get_time();
$this->rendered_content = $this->smarty->cache_resource_objects[$this->caching_type]->getCachedContents($this); $this->rendered_content = $this->smarty->cache_resource_objects[$this->caching_type]->getCachedContents($this);
$this->cache_time += $this->_get_time() - $_start_time; $this->cache_time += $this->_get_time() - $_start_time;
if ($this->caching == SMARTY_CACHING_LIVETIME_SAVED && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']) || $this->properties['cache_lifetime'] < 0)) { if ($this->caching == SMARTY_CACHING_LIVETIME_SAVED && $this->properties['cache_lifetime'] >0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
$this->rendered_content = null; $this->rendered_content = null;
return $this->isCached; return $this->isCached;
} }