Clear opcode caches after writing to the config file, fixes #3372
This commit is contained in:
parent
c62f230ddb
commit
0a29d2029a
|
@ -187,7 +187,7 @@ class OC_Config{
|
|||
}
|
||||
// Prevent others not to read the config
|
||||
@chmod($filename, 0640);
|
||||
|
||||
OC_Util::clearOpcodeCache();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
19
lib/util.php
19
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue