Skip to content
Snippets Groups Projects
Commit 0a29d202 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Clear opcode caches after writing to the config file, fixes #3372

parent c62f230d
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,7 @@ class OC_Config{
}
// Prevent others not to read the config
@chmod($filename, 0640);
OC_Util::clearOpcodeCache();
return true;
}
}
......@@ -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);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment