isRenderingCache = $this instanceof Smarty_Template_Cached; $unifunc = isset($unifunc) ? $unifunc : $this->unifunc; $level = ob_get_level(); try { if (empty($unifunc) || !is_callable($unifunc)) { throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'"); } if (isset($_template->smarty->security_policy)) { $_template->smarty->security_policy->startTemplate($_template); } // // render compiled or saved template code // if (!isset($_template->_cache[ 'capture_stack' ])) { $_template->_cache[ 'capture_stack' ] = array(); } $_saved_capture_level = count($_template->_cache[ 'capture_stack' ]); $unifunc($_template); // any unclosed {capture} tags ? if ($_saved_capture_level != count($_template->_cache[ 'capture_stack' ])) { $_template->capture_error(); } if (isset($_template->smarty->security_policy)) { $_template->smarty->security_policy->exitTemplate(); } $_template->isRenderingCache = false; return null; } catch (Exception $e) { $_template->isRenderingCache = false; while (ob_get_level() > $level) { ob_end_clean(); } if (isset($_template->smarty->security_policy)) { $_template->smarty->security_policy->exitTemplate(); } throw $e; } } /** * Get compiled time stamp * * @return int */ public function getTimeStamp() { if ($this->exists && !isset($this->timestamp)) { $this->timestamp = @filemtime($this->filepath); } return $this->timestamp; } }