mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-03 05:56:43 +00:00
Extend opcache check if it is enabled
When trying to deploy October on shared hosting (www.websupport.sk) I received following error when accessing the frontend pages - ErrorException:> Zend OPcache API is restricted by "restrict_api" configuration directive. Backend was working normally. I propose the following change to check not only if the opcache_invalidate exists but also if opcache is enabled. The change was also needed in octobercms files, but to correspond I am also proposing to add it directly to twig.
This commit is contained in:
committed by
Fabien Potencier
parent
c41d567956
commit
6e68bd0815
@@ -67,7 +67,7 @@ class FilesystemCache implements CacheInterface
|
||||
|
||||
if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
|
||||
// Compile cached file into bytecode cache
|
||||
if (\function_exists('opcache_invalidate')) {
|
||||
if (\function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
|
||||
opcache_invalidate($key, true);
|
||||
} elseif (\function_exists('apc_compile_file')) {
|
||||
apc_compile_file($key);
|
||||
|
||||
Reference in New Issue
Block a user