Extend opcache check if it is enabled (#3664)

Credit to @vosco88. 
When trying to deploy October on shared hosting (www.websupport.sk) it is possible to receive the following error when accessing the frontend pages - ErrorException:> Zend OPcache API is restricted by "restrict_api" configuration directive. This checks not only if the opcache_invalidate exists but also if opcache is enabled. Same check is actually present in twig vendor files - but so far it is working without having the check there.
This commit is contained in:
vosco88 2018-11-23 16:36:24 +01:00 committed by Luke Towers
parent 9c2bb8469e
commit 2d1a904512
1 changed files with 1 additions and 1 deletions

View File

@ -334,7 +334,7 @@ class CodeParser
* Compile cached file into bytecode cache
*/
if (Config::get('cms.forceBytecodeInvalidation', false)) {
if (function_exists('opcache_invalidate')) {
if (function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
opcache_invalidate($path, true);
}
elseif (function_exists('apc_compile_file')) {