mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fixed multiple redundant occurrences for 'config' and 'template' in
$smarty->_cache_info
This commit is contained in:
@@ -1150,7 +1150,7 @@ class Smarty
|
|||||||
'tpl_file' => $tpl_file,
|
'tpl_file' => $tpl_file,
|
||||||
'cache_id' => $cache_id,
|
'cache_id' => $cache_id,
|
||||||
'compile_id' => $compile_id,
|
'compile_id' => $compile_id,
|
||||||
'results' => $_smarty_results
|
'results' => null
|
||||||
);
|
);
|
||||||
if ($this->_execute_core_function('read_cache_file', $_params)) {
|
if ($this->_execute_core_function('read_cache_file', $_params)) {
|
||||||
$_smarty_results = $_params['results'];
|
$_smarty_results = $_params['results'];
|
||||||
@@ -1192,7 +1192,7 @@ class Smarty
|
|||||||
return $_smarty_results;
|
return $_smarty_results;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->_cache_info['template'][] = $tpl_file;
|
$this->_cache_info['template'][$tpl_file] = true;
|
||||||
if ($this->cache_modified_check) {
|
if ($this->cache_modified_check) {
|
||||||
header("Last-Modified: ".gmdate('D, d M Y H:i:s', time()).' GMT');
|
header("Last-Modified: ".gmdate('D, d M Y H:i:s', time()).' GMT');
|
||||||
}
|
}
|
||||||
|
@@ -68,7 +68,7 @@ function smarty_core_read_cache_file(&$params, &$this)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->compile_check) {
|
if ($this->compile_check) {
|
||||||
foreach ($this->_cache_info['template'] as $_template_dep) {
|
foreach (array_keys($this->_cache_info['template']) as $_template_dep) {
|
||||||
$_params = array('tpl_path' => $_template_dep);
|
$_params = array('tpl_path' => $_template_dep);
|
||||||
$this->_execute_core_function('fetch_template_info', $_params);
|
$this->_execute_core_function('fetch_template_info', $_params);
|
||||||
if ($this->_cache_info['timestamp'] < $_params['template_timestamp']) {
|
if ($this->_cache_info['timestamp'] < $_params['template_timestamp']) {
|
||||||
@@ -78,7 +78,7 @@ function smarty_core_read_cache_file(&$params, &$this)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->_cache_info['config'])) {
|
if (isset($this->_cache_info['config'])) {
|
||||||
foreach ($this->_cache_info['config'] as $config_dep) {
|
foreach (array_keys($this->_cache_info['config']) as $config_dep) {
|
||||||
if ($this->_cache_info['timestamp'] < filemtime($this->config_dir . DIRECTORY_SEPARATOR . $config_dep)) {
|
if ($this->_cache_info['timestamp'] < filemtime($this->config_dir . DIRECTORY_SEPARATOR . $config_dep)) {
|
||||||
// config file has changed, regenerate cache
|
// config file has changed, regenerate cache
|
||||||
return false;
|
return false;
|
||||||
|
@@ -49,7 +49,7 @@ function smarty_core_smarty_include($params, &$this)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->caching) {
|
if ($this->caching) {
|
||||||
$this->_cache_info['template'][] = $params['smarty_include_tpl_file'];
|
$this->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -105,7 +105,7 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($smarty->caching) {
|
if ($smarty->caching) {
|
||||||
$smarty->_cache_info['config'][] = $_file;
|
$smarty->_cache_info['config'][$_file] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
|
$smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
|
||||||
|
Reference in New Issue
Block a user