mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
- internal change on merging some data
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
12/29/2009
|
12/29/2009
|
||||||
- use sha1() for filepath encoding
|
- use sha1() for filepath encoding
|
||||||
- updates on nocache_hash handling
|
- updates on nocache_hash handling
|
||||||
|
- internal change on merging some data
|
||||||
|
|
||||||
12/28/2009
|
12/28/2009
|
||||||
- update for security fixes
|
- update for security fixes
|
||||||
|
@@ -79,7 +79,8 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
|||||||
}
|
}
|
||||||
$compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']);
|
$compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']);
|
||||||
$compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']);
|
$compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']);
|
||||||
$compiler->template->required_plugins = array_merge_recursive($compiler->template->required_plugins, $_tpl->required_plugins);
|
$compiler->template->required_plugins['compiled'] = array_merge($compiler->template->required_plugins['compiled'], $_tpl->required_plugins['compiled']);
|
||||||
|
$compiler->template->required_plugins['cache'] = array_merge($compiler->template->required_plugins['cache'], $_tpl->required_plugins['cache']);
|
||||||
unset($_tpl);
|
unset($_tpl);
|
||||||
} else {
|
} else {
|
||||||
$_output = $compiler->template->extracted_compiled_code;
|
$_output = $compiler->template->extracted_compiled_code;
|
||||||
|
@@ -68,7 +68,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
// storage for block data
|
// storage for block data
|
||||||
public $block_data = array();
|
public $block_data = array();
|
||||||
// required plugins
|
// required plugins
|
||||||
public $required_plugins = array();
|
public $required_plugins = array('compiled' => array(), 'cache' => array());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create template data object
|
* Create template data object
|
||||||
@@ -360,10 +360,10 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
public function isCached ()
|
public function isCached ()
|
||||||
{
|
{
|
||||||
if ($this->isCached === null) {
|
if ($this->isCached === null) {
|
||||||
|
$this->isCached = false;
|
||||||
if (($this->caching == 1 || $this->caching == 2) && !$this->resource_object->isEvaluated && !$this->force_compile && !$this->force_cache) {
|
if (($this->caching == 1 || $this->caching == 2) && !$this->resource_object->isEvaluated && !$this->force_compile && !$this->force_cache) {
|
||||||
$cachedTimestamp = $this->getCachedTimestamp();
|
$cachedTimestamp = $this->getCachedTimestamp();
|
||||||
if ($cachedTimestamp === false) {
|
if ($cachedTimestamp === false) {
|
||||||
$this->isCached = false;
|
|
||||||
return $this->isCached;
|
return $this->isCached;
|
||||||
}
|
}
|
||||||
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED || ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT && (time() <= ($cachedTimestamp + $this->cache_lifetime) || $this->cache_lifetime < 0))) {
|
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED || ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT && (time() <= ($cachedTimestamp + $this->cache_lifetime) || $this->cache_lifetime < 0))) {
|
||||||
@@ -374,9 +374,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
if ($this->smarty->debugging) {
|
if ($this->smarty->debugging) {
|
||||||
Smarty_Internal_Debug::end_cache($this);
|
Smarty_Internal_Debug::end_cache($this);
|
||||||
}
|
}
|
||||||
if ($this->isCached === false) {
|
|
||||||
return $this->isCached;
|
|
||||||
}
|
|
||||||
if ($this->cacheFileChecked) {
|
if ($this->cacheFileChecked) {
|
||||||
$this->isCached = true;
|
$this->isCached = true;
|
||||||
return $this->isCached;
|
return $this->isCached;
|
||||||
@@ -384,7 +381,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
$this->cacheFileChecked = true;
|
$this->cacheFileChecked = true;
|
||||||
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] > 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
|
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] > 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
|
||||||
$this->rendered_content = null;
|
$this->rendered_content = null;
|
||||||
$this->isCached = false;
|
|
||||||
return $this->isCached;
|
return $this->isCached;
|
||||||
}
|
}
|
||||||
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {
|
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {
|
||||||
@@ -399,7 +395,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
// If ($mtime > $this->getCachedTimestamp()) {
|
// If ($mtime > $this->getCachedTimestamp()) {
|
||||||
If ($mtime > $_file_to_check[1]) {
|
If ($mtime > $_file_to_check[1]) {
|
||||||
$this->rendered_content = null;
|
$this->rendered_content = null;
|
||||||
$this->isCached = false;
|
|
||||||
return $this->isCached;
|
return $this->isCached;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,9 +403,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->isCached === null) {
|
|
||||||
$this->isCached = false;
|
|
||||||
}
|
|
||||||
return $this->isCached;
|
return $this->isCached;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,7 +473,8 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
}
|
}
|
||||||
if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {
|
if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {
|
||||||
$this->parent->properties['file_dependency'] = array_merge($this->parent->properties['file_dependency'], $this->properties['file_dependency']);
|
$this->parent->properties['file_dependency'] = array_merge($this->parent->properties['file_dependency'], $this->properties['file_dependency']);
|
||||||
$this->parent->required_plugins = array_merge_recursive($this->parent->required_plugins, $this->required_plugins);
|
$this->parent->required_plugins['compiled'] = array_merge($this->parent->required_plugins['compiled'], $this->required_plugins['compiled']);
|
||||||
|
$this->parent->required_plugins['cache'] = array_merge($this->parent->required_plugins['cache'], $this->required_plugins['cache']);
|
||||||
}
|
}
|
||||||
if ($this->smarty->debugging) {
|
if ($this->smarty->debugging) {
|
||||||
Smarty_Internal_Debug::end_render($this);
|
Smarty_Internal_Debug::end_render($this);
|
||||||
@@ -751,7 +744,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// build property code
|
// build property code
|
||||||
$this->properties['fullpath'] = realpath($this->resource_object->getTemplateFilepath($this));
|
|
||||||
$this->properties['has_nocache_code'] = $this->has_nocache_code;
|
$this->properties['has_nocache_code'] = $this->has_nocache_code;
|
||||||
$properties_string = "<?php /*%%SmartyHeaderCode:{$this->properties['nocache_hash']}%%*/" ;
|
$properties_string = "<?php /*%%SmartyHeaderCode:{$this->properties['nocache_hash']}%%*/" ;
|
||||||
if ($this->smarty->direct_access_security) {
|
if ($this->smarty->direct_access_security) {
|
||||||
@@ -779,10 +771,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
*/
|
*/
|
||||||
public function decodeProperties ($properties)
|
public function decodeProperties ($properties)
|
||||||
{
|
{
|
||||||
if ($properties['fullpath'] != realpath($this->resource_object->getTemplateFilepath($this))) {
|
|
||||||
$this->isCached = false;
|
|
||||||
$this->mustCompile = true;
|
|
||||||
} ;
|
|
||||||
$this->has_nocache_code = $properties['has_nocache_code'];
|
$this->has_nocache_code = $properties['has_nocache_code'];
|
||||||
$this->properties['nocache_hash'] = $properties['nocache_hash'];
|
$this->properties['nocache_hash'] = $properties['nocache_hash'];
|
||||||
if (isset($properties['cache_lifetime'])) {
|
if (isset($properties['cache_lifetime'])) {
|
||||||
|
Reference in New Issue
Block a user