- new feature If ACP is enabled force an apc_compile_file() when compiled or cached template was updated

This commit is contained in:
uwetews
2015-12-25 10:29:29 +01:00
parent 613e66c257
commit fbf544286a
4 changed files with 12 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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')) {