From ab5d8d4e07bb3c8230d0285ef8902ef1979fce51 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 18 Oct 2018 02:39:34 +0200 Subject: Updating Smarty --- .../sysplugins/smarty_template_resource_base.php | 152 +++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 lib/smarty/sysplugins/smarty_template_resource_base.php (limited to 'lib/smarty/sysplugins/smarty_template_resource_base.php') diff --git a/lib/smarty/sysplugins/smarty_template_resource_base.php b/lib/smarty/sysplugins/smarty_template_resource_base.php new file mode 100644 index 0000000..52bfba2 --- /dev/null +++ b/lib/smarty/sysplugins/smarty_template_resource_base.php @@ -0,0 +1,152 @@ +smarty; + $_template->isRenderingCache = $this->isCache; + $level = ob_get_level(); + try { + if (!isset($unifunc)) { + $unifunc = $this->unifunc; + } + if (empty($unifunc) || !function_exists($unifunc)) { + throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'"); + } + if ($_template->startRenderCallbacks) { + foreach ($_template->startRenderCallbacks as $callback) { + call_user_func($callback, $_template); + } + } + $unifunc($_template); + foreach ($_template->endRenderCallbacks as $callback) { + call_user_func($callback, $_template); + } + $_template->isRenderingCache = false; + } catch (Exception $e) { + $_template->isRenderingCache = false; + while (ob_get_level() > $level) { + ob_end_clean(); + } + if (isset($smarty->security_policy)) { + $smarty->security_policy->endTemplate(); + } + throw $e; + } + } + + /** + * Get compiled time stamp + * + * @return int + */ + public function getTimeStamp() + { + if ($this->exists && !$this->timestamp) { + $this->timestamp = filemtime($this->filepath); + } + return $this->timestamp; + } +} -- cgit v1.2.3