mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 02:16:41 +00:00
bug #3105 Handle opcache_invalidate() being disabled on shared hosting platforms (RhvsW)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #3105).
Discussion
----------
Handle opcache_invalidate() being disabled on shared hosting platforms
This fix makes twig gracefully fail on opcache API being disabled on shared hosting platforms for security reasons.
Tested with Grav CMS.
Commits
-------
349a5f26 Handle opcache_invalidate() being disabled on shared hosting platforms
This commit is contained in:
@@ -68,7 +68,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') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
opcache_invalidate($key, true);
|
||||
@opcache_invalidate($key, true);
|
||||
} elseif (\function_exists('apc_compile_file')) {
|
||||
apc_compile_file($key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user