From 79d955503ff3be0f8c6a22d8c374bc69eb59091f Mon Sep 17 00:00:00 2001 From: messju Date: Mon, 12 May 2003 07:53:57 +0000 Subject: [PATCH] fixed multiple redundant occurrences for 'config' and 'template' in $smarty->_cache_info --- libs/Smarty.class.php | 4 ++-- libs/plugins/core.read_cache_file.php | 4 ++-- libs/plugins/core.smarty_include.php | 2 +- libs/plugins/function.config_load.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index d8d6e4ec..bbe597e0 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1150,7 +1150,7 @@ class Smarty 'tpl_file' => $tpl_file, 'cache_id' => $cache_id, 'compile_id' => $compile_id, - 'results' => $_smarty_results + 'results' => null ); if ($this->_execute_core_function('read_cache_file', $_params)) { $_smarty_results = $_params['results']; @@ -1192,7 +1192,7 @@ class Smarty return $_smarty_results; } } else { - $this->_cache_info['template'][] = $tpl_file; + $this->_cache_info['template'][$tpl_file] = true; if ($this->cache_modified_check) { header("Last-Modified: ".gmdate('D, d M Y H:i:s', time()).' GMT'); } diff --git a/libs/plugins/core.read_cache_file.php b/libs/plugins/core.read_cache_file.php index f169dfa2..cc136a73 100644 --- a/libs/plugins/core.read_cache_file.php +++ b/libs/plugins/core.read_cache_file.php @@ -68,7 +68,7 @@ function smarty_core_read_cache_file(&$params, &$this) } 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); $this->_execute_core_function('fetch_template_info', $_params); 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'])) { - 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)) { // config file has changed, regenerate cache return false; diff --git a/libs/plugins/core.smarty_include.php b/libs/plugins/core.smarty_include.php index 07bb3d8b..e9d6930b 100644 --- a/libs/plugins/core.smarty_include.php +++ b/libs/plugins/core.smarty_include.php @@ -49,7 +49,7 @@ function smarty_core_smarty_include($params, &$this) } if ($this->caching) { - $this->_cache_info['template'][] = $params['smarty_include_tpl_file']; + $this->_cache_info['template'][$params['smarty_include_tpl_file']] = true; } } diff --git a/libs/plugins/function.config_load.php b/libs/plugins/function.config_load.php index 41d983b3..336d8f3f 100644 --- a/libs/plugins/function.config_load.php +++ b/libs/plugins/function.config_load.php @@ -105,7 +105,7 @@ function smarty_function_config_load($params, &$smarty) } 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);