diff --git a/NEW_FEATURES.txt b/NEW_FEATURES.txt index 9a33dd75..5d130a94 100644 --- a/NEW_FEATURES.txt +++ b/NEW_FEATURES.txt @@ -14,6 +14,10 @@ Smarty 3.1.30 The content of the compiled template may depend on the template_dir search order {include .... inline} is used or $smarty->merge_compiled_includes is enabled + ACP + === + If ACP is enabled force an apc_compile_file() when compiled or cached template was updated + Smarty 3.1.28 OPCACHE diff --git a/change_log.txt b/change_log.txt index e195ed64..344aa65c 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,8 @@ 25.12.2015 - compile {block} tag code and its processing into classes - optimization replace hhvm extension by inline code + - new feature If ACP is enabled force an apc_compile_file() when compiled or cached template was updated + 24.12.2015 - new feature Compiler does now observe the template_dir setting and will create separate compiled files if required diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index 7ae752a0..23467c59 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -117,7 +117,9 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource { if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath, $content, $_template->smarty) === true) { if (function_exists('opcache_invalidate')) { - opcache_invalidate($_template->cached->filepath); + opcache_invalidate($_template->cached->filepath, true); + } elseif (function_exists('apc_compile_file')) { + apc_compile_file($_template->cached->filepath); } $cached = $_template->cached; $cached->timestamp = $cached->exists = is_file($cached->filepath); diff --git a/libs/sysplugins/smarty_template_compiled.php b/libs/sysplugins/smarty_template_compiled.php index 11e27916..15273365 100644 --- a/libs/sysplugins/smarty_template_compiled.php +++ b/libs/sysplugins/smarty_template_compiled.php @@ -165,7 +165,9 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base private function loadCompiledTemplate(Smarty_Internal_Template $_template) { if (function_exists('opcache_invalidate')) { - opcache_invalidate($_template->compiled->filepath); + opcache_invalidate($_template->compiled->filepath, true); + } elseif (function_exists('apc_compile_file')) { + apc_compile_file($_template->compiled->filepath); } $_smarty_tpl = $_template; if (defined('HHVM_VERSION')) {