mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 12:54:26 +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
|
10/05/2010
|
||||||
- bugfix on {foreach} and {for} optimizations of 27/04/2010
|
- bugfix on {foreach} and {for} optimizations of 27/04/2010
|
||||||
|
|
||||||
|
@@ -291,6 +291,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
*/
|
*/
|
||||||
public function getCachedFilepath ()
|
public function getCachedFilepath ()
|
||||||
{
|
{
|
||||||
|
if (!isset($this->cache_resource_object)) {
|
||||||
|
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||||
|
}
|
||||||
return $this->cached_filepath === null ?
|
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 = ($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;
|
$this->cached_filepath;
|
||||||
@@ -305,6 +308,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
*/
|
*/
|
||||||
public function getCachedTimestamp ()
|
public function getCachedTimestamp ()
|
||||||
{
|
{
|
||||||
|
if (!isset($this->cache_resource_object)) {
|
||||||
|
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||||
|
}
|
||||||
return $this->cached_timestamp === null ?
|
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 = ($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;
|
$this->cached_timestamp;
|
||||||
@@ -317,6 +323,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
*/
|
*/
|
||||||
public function getCachedContent ()
|
public function getCachedContent ()
|
||||||
{
|
{
|
||||||
|
if (!isset($this->cache_resource_object)) {
|
||||||
|
$this->cache_resource_object = $this->smarty->cache->loadResource();
|
||||||
|
}
|
||||||
return $this->rendered_content === null ?
|
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 = ($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;
|
$this->rendered_content;
|
||||||
|
Reference in New Issue
Block a user