Issue with Config and opcode cache
Remi Collet <[email protected]>
| Newsgroups | gmane.comp.horde.devel |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, When using an opcode cache, configuration files are cached. So, after a configuration file is updated, its old content will be served by cached until invalidated, or checked. With Zend Opcache, default check delay is 2" opcache.revalidate_freq=2 And, it is common to have a greater value on production env. The small patch attached should fix this (only for opcache, other opcode caches such as XCache or deprecated APC are not handled) Notice, this is just a quick fix, perhaps you could integrate the feature in a different way, just want to raise the issue and a possible fix. Regards, Remi. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlQKvqoACgkQYUppBSnxahgvigCg9O2Qu4+xrkiyDcWMR3IzKMQb fXgAnA2voMMfEXvwre0AMEIU5ywBMBqc =NqUW -----END PGP SIGNATURE----- -- dev mailing list Frequently Asked Questions: http://wiki.horde.org/FAQ To unsubscribe, mail: [email protected]
horde-opcache.patch
(text/x-patch, 851 B)
--- Horde/Config.php.old 2014-09-06 09:42:31.402451442 +0200
+++ Horde/Config.php 2014-09-06 09:57:15.473336313 +0200
@@ -301,7 +301,11 @@
fwrite($fp, $php);
fclose($fp);
$GLOBALS['registry']->rebuild();
- $GLOBALS['notification']->push(sprintf(Horde_Core_Translation::t("Successfully wrote %s"), Horde_Util::realPath($configFile)), 'horde.success');
+ $GLOBALS['notification']->push(sprintf(Horde_Core_Translation::t("Successfully wrote %s"), $rp = Horde_Util::realPath($configFile)), 'horde.success');
+
+ if (function_exists('opcache_invalidate') && opcache_invalidate($rp)) {
+ $GLOBALS['notification']->push(sprintf(Horde_Core_Translation::t("Successfully removed from cache %s"), $rp), 'horde.success');
+ }
return true;
}