- remove redundant code

This commit is contained in:
uwetews
2015-08-23 13:53:03 +02:00
parent 9eb87ef5a2
commit 9fd0b3086d
2 changed files with 2 additions and 43 deletions

View File

@@ -13,6 +13,7 @@
- optimize Smarty::templateExists()
- optimize use_include_path processing
- relocate properties for size optimization
- remove redundant code
06.08.2015
- avoid possible circular object references caused by parser/lexer objects

View File

@@ -256,48 +256,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
}
}
/**
* get rendered template content by calling compiled or cached template code
*
* @param string $unifunc function with template code
*
* @return string
* @throws \Exception
*/
public function getRenderedTemplateCode($unifunc)
{
$level = ob_get_level();
try {
if (empty($unifunc) || !is_callable($unifunc)) {
throw new SmartyException("Invalid compiled template for '{$this->template_resource}'");
}
if (isset($this->smarty->security_policy)) {
$this->smarty->security_policy->startTemplate($this);
}
//
// render compiled or saved template code
//
$unifunc($this);
// any unclosed {capture} tags ?
if (isset($this->_cache['capture_stack'][0])) {
$this->capture_error();
}
if (isset($this->smarty->security_policy)) {
$this->smarty->security_policy->exitTemplate();
}
return null;
}
catch (Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
if (isset($this->smarty->security_policy)) {
$this->smarty->security_policy->exitTemplate();
}
throw $e;
}
}
/**
* Compiles the template
* If the template is not evaluated the compiled template is saved on disk
@@ -443,7 +401,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
$this->smarty->_debug->start_template($tpl);
$this->smarty->_debug->start_render($tpl);
}
$tpl->getRenderedTemplateCode($content_func);
$tpl->compiled->getRenderedTemplateCode($tpl, $content_func);
if ($this->smarty->debugging) {
$this->smarty->_debug->end_template($tpl);
$this->smarty->_debug->end_render($tpl);