From bf8275ee20ace069423f6dac41fc1db66379f63e Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Mon, 16 Sep 2013 18:47:04 +0000 Subject: [PATCH] - bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_templatebase.php | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index 8b88383b..d7551bfa 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +16.09.2013 + - bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320) + 13.09.2013 - bugfix html_select_time defaulting error for the Meridian dropdown (forum topic 24549) diff --git a/libs/sysplugins/smarty_internal_templatebase.php b/libs/sysplugins/smarty_internal_templatebase.php index 6e323701..8ce6d5ec 100644 --- a/libs/sysplugins/smarty_internal_templatebase.php +++ b/libs/sysplugins/smarty_internal_templatebase.php @@ -147,6 +147,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data } else { if (!$_template->compiled->exists || ($_template->smarty->force_compile && !$_template->compiled->isCompiled)) { $_template->compileTemplateSource(); + $code = file_get_contents($_template->compiled->filepath); + eval("?>" . $code); + unset($code); + $_template->compiled->loaded = true; + $_template->compiled->isCompiled = true; } if ($this->smarty->debugging) { Smarty_Internal_Debug::start_render($_template); @@ -156,7 +161,10 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data if ($_template->mustCompile) { // recompile and load again $_template->compileTemplateSource(); - include($_template->compiled->filepath); + $code = file_get_contents($_template->compiled->filepath); + eval("?>" . $code); + unset($code); + $_template->compiled->isCompiled = true; } $_template->compiled->loaded = true; } else {