- change of utility->compileAllTemplates() log messages

- bugfix on nocache code in {function} tags
This commit is contained in:
Uwe.Tews
2010-03-25 20:43:56 +00:00
parent 8372ef8874
commit c24dce9ed4
3 changed files with 83 additions and 74 deletions

View File

@@ -37,7 +37,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
// make function known for recursive calls
$this->compiler->smarty->template_functions[$_name]['compiled'] = '';
// Init temporay context
$compiler->template->required_plugins = array('compiled' => array(), 'cache' => array());
$compiler->template->required_plugins = array('compiled' => array(), 'nocache' => array());
$compiler->template->extract_code = true;
$compiler->template->extracted_compiled_code = '';
$compiler->template->has_nocache_code = false;
@@ -75,11 +75,11 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
}
$plugins_string .= '?>';
}
if (!empty($compiler->template->required_plugins['cache'])) {
if (!empty($compiler->template->required_plugins['nocache'])) {
$plugins_string .= "<?php echo '/*%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/<?php ";
foreach($compiler->template->required_plugins['nocache'] as $tmp) {
foreach($tmp as $data) {
$plugins_string .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n";
$plugins_string .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n";
}
}
$plugins_string .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';?>\n";
@@ -97,4 +97,4 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
}
}
?>
?>