improved checking of compiled_include against cached-template with non-cached-chunks

This commit is contained in:
messju
2003-07-17 19:25:22 +00:00
parent 84322ae6b3
commit 48d8b66ae1
2 changed files with 10 additions and 4 deletions

View File

@@ -18,7 +18,6 @@ function smarty_core_process_compiled_include($params, &$smarty)
{
$_return = $params['results'];
foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) {
$smarty->smarty_include($_include_file_path, true);
$_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s',
array(&$smarty, '_process_compiled_include_callback'),
$_return);

View File

@@ -91,9 +91,16 @@ function smarty_core_read_cache_file(&$params, &$smarty)
}
}
$smarty->_cache_serials = array_merge($smarty->_cache_serials,
$smarty->_cache_info['cache_serials']);
foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
if (empty($smarty->_cache_serials[$_include_file_path])) {
$smarty->smarty_include($_include_file_path, true);
}
if ($smarty->_cache_serials[$_include_file_path] != $_cache_serial) {
/* regenerate */
return false;
}
}
$params['results'] = $cache_split[1];
$content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $smarty->_cache_info);