fixed unnecessary load of source in template_exists() and the

compile-check of smarty_core_read_cache_file()
This commit is contained in:
messju
2003-08-18 10:17:28 +00:00
parent 6f473f2820
commit 09aa653a75
2 changed files with 4 additions and 3 deletions

View File

@@ -1108,7 +1108,7 @@ class Smarty
*/ */
function template_exists($tpl_file) function template_exists($tpl_file)
{ {
$_params = array('resource_name' => $tpl_file); $_params = array('resource_name' => $tpl_file, 'get_source'=>false);
return $this->_fetch_resource_info($_params); return $this->_fetch_resource_info($_params);
} }

View File

@@ -68,8 +68,9 @@ function smarty_core_read_cache_file(&$params, &$smarty)
} }
if ($smarty->compile_check) { if ($smarty->compile_check) {
$_params = array('get_source' => false);
foreach (array_keys($smarty->_cache_info['template']) as $_template_dep) { foreach (array_keys($smarty->_cache_info['template']) as $_template_dep) {
$_params = array('resource_name' => $_template_dep); $_params['resource_name'] = $_template_dep;
$smarty->_fetch_resource_info($_params); $smarty->_fetch_resource_info($_params);
if ($smarty->_cache_info['timestamp'] < $_params['resource_timestamp']) { if ($smarty->_cache_info['timestamp'] < $_params['resource_timestamp']) {
// template file has changed, regenerate cache // template file has changed, regenerate cache
@@ -78,7 +79,7 @@ function smarty_core_read_cache_file(&$params, &$smarty)
} }
if (isset($smarty->_cache_info['config'])) { if (isset($smarty->_cache_info['config'])) {
$_params = array('resource_base_path' => $smarty->config_dir); $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false);
foreach (array_keys($smarty->_cache_info['config']) as $_config_dep) { foreach (array_keys($smarty->_cache_info['config']) as $_config_dep) {
$_params['resource_name'] = $_config_dep; $_params['resource_name'] = $_config_dep;
$smarty->_fetch_resource_info($_params); $smarty->_fetch_resource_info($_params);