diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-25 19:25:43 +0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-25 19:25:43 +0400 |
commit | 0a29d2029a719d42f347edb95bd6486c2ab842a8 (patch) | |
tree | 3936a54c91eb03bdaab0334f48ab4af3406594ef /lib/util.php | |
parent | c62f230ddb4304faa9455e849b393693fc9b14aa (diff) |
Clear opcode caches after writing to the config file, fixes #3372
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index f30cdf6a534..a7ed0379294 100755 --- a/lib/util.php +++ b/lib/util.php @@ -822,5 +822,24 @@ class OC_Util { return $theme; } + /** + * Clear the opcode cache if one exists + * This is necessary for writing to the config file + * in case the opcode cache doesn't revalidate files + */ + public static function clearOpcodeCache() { + // APC + if (function_exists('apc_clear_cache')) { + apc_clear_cache(); + } + // Zend Opcache + if (function_exists('accelerator_reset')) { + accelerator_reset(); + } + // XCache + if (function_exists('xcache_clear_cache')) { + xcache_clear_cache(XC_TYPE_VAR, 0); + } + } } |