mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
- bugfix make sure that the cache resource is loaded in all conditions when template methods getCached... are called externally
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
11/05/2010
|
||||
- bugfix make sure that the cache resource is loaded in all conditions when template methods getCached... are called externally
|
||||
|
||||
10/05/2010
|
||||
- bugfix on {foreach} and {for} optimizations of 27/04/2010
|
||||
|
||||
|
@@ -271,7 +271,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
touch($this->getCompiledFilepath(), $saved_timestamp);
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
// compiling succeded
|
||||
if (!$this->resource_object->isEvaluated) {
|
||||
// write compiled template
|
||||
@@ -291,6 +291,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
*/
|
||||
public function getCachedFilepath ()
|
||||
{
|
||||
if (!isset($this->cache_resource_object)) {
|
||||
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||
}
|
||||
return $this->cached_filepath === null ?
|
||||
$this->cached_filepath = ($this->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedFilepath($this) :
|
||||
$this->cached_filepath;
|
||||
@@ -305,6 +308,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
*/
|
||||
public function getCachedTimestamp ()
|
||||
{
|
||||
if (!isset($this->cache_resource_object)) {
|
||||
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||
}
|
||||
return $this->cached_timestamp === null ?
|
||||
$this->cached_timestamp = ($this->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedTimestamp($this) :
|
||||
$this->cached_timestamp;
|
||||
@@ -317,6 +323,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
*/
|
||||
public function getCachedContent ()
|
||||
{
|
||||
if (!isset($this->cache_resource_object)) {
|
||||
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||
}
|
||||
return $this->rendered_content === null ?
|
||||
$this->rendered_content = ($this->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedContents($this) :
|
||||
$this->rendered_content;
|
||||
|
Reference in New Issue
Block a user