From f63099e00b3b8b4e3890f2c0138f1345cf0e2632 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sun, 13 Sep 2015 18:50:03 +0200 Subject: [PATCH] No need to check modification time when opcache_invalidate - We know the file is new - No need to check if opcache/apc is enabled as these methods will just return false in this case --- lib/Twig/Cache/Filesystem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Twig/Cache/Filesystem.php b/lib/Twig/Cache/Filesystem.php index 8675e0750..c33fa90d9 100644 --- a/lib/Twig/Cache/Filesystem.php +++ b/lib/Twig/Cache/Filesystem.php @@ -80,9 +80,9 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { // Compile cached file into bytecode cache - if (function_exists('opcache_invalidate') && ini_get('opcache.enable')) { - opcache_invalidate($key); - } elseif (function_exists('apc_compile_file') && ini_get('apc.enabled')) { + if (function_exists('opcache_invalidate')) { + opcache_invalidate($key, true); + } elseif (function_exists('apc_compile_file')) { apc_compile_file($key); } }