Skip to content

Commit

Permalink
- bugfix avoid opcache_invalidate to result in ErrorException when op…
Browse files Browse the repository at this point in the history
…cache.restrict_api is not empty #244
  • Loading branch information
uwetews committed Jul 18, 2016
1 parent 92945ea commit d854219
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
18.07.2016
- bugfix {foreach} if key variable and item@key attribute have been used both the key variable was not updated https://github.com/smarty-php/smarty/issues/254
- bugfix modifier on plugins like {plugin|modifier ... } did fail when the plugin does return an array https://github.com/smarty-php/smarty/issues/228
- bugfix avoid opcache_invalidate to result in ErrorException when opcache.restrict_api is not empty https://github.com/smarty-php/smarty/pull/244

14.07.2016
- bugfix wrong parameter on compileAllTemplates() and compileAllConfig() https://github.com/smarty-php/smarty/issues/231
Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.30-dev/82';
const SMARTY_VERSION = '3.1.30-dev/83';

/**
* define variable scopes
Expand Down
2 changes: 1 addition & 1 deletion libs/sysplugins/smarty_internal_cacheresource_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function writeCachedContent(Smarty_Internal_Template $_template, $content
if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath, $content,
$_template->smarty) === true
) {
if (function_exists('opcache_invalidate')) {
if (function_exists('opcache_invalidate') && strlen(ini_get("opcache.restrict_api")) < 1) {
opcache_invalidate($_template->cached->filepath, true);
} elseif (function_exists('apc_compile_file')) {
apc_compile_file($_template->cached->filepath);
Expand Down
2 changes: 1 addition & 1 deletion libs/sysplugins/smarty_internal_extension_clear.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static function clear(Smarty $smarty, $resource_name, $cache_id, $compile
}
}
$_count += @unlink((string) $_file) ? 1 : 0;
if (function_exists('opcache_invalidate')) {
if (function_exists('opcache_invalidate') && strlen(ini_get("opcache.restrict_api")) < 1) {
opcache_invalidate((string) $_file, true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $co

if ($unlink && @unlink($_filepath)) {
$_count ++;
if (function_exists('opcache_invalidate')) {
if (function_exists('opcache_invalidate') && strlen(ini_get("opcache.restrict_api")) < 1) {
opcache_invalidate($_filepath, true);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libs/sysplugins/smarty_template_compiled.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function process(Smarty_Internal_Template $_smarty_tpl)
*/
private function loadCompiledTemplate(Smarty_Internal_Template $_smarty_tpl)
{
if (function_exists('opcache_invalidate')) {
if (function_exists('opcache_invalidate') && strlen(ini_get("opcache.restrict_api")) < 1) {
opcache_invalidate($this->filepath, true);
} elseif (function_exists('apc_compile_file')) {
apc_compile_file($this->filepath);
Expand Down

0 comments on commit d854219

Please sign in to comment.