summaryrefslogtreecommitdiffstats
path: root/lib/util.php
diff options
context:
space:
mode:
authorGeorg Ehrke <georg@ownCloud.com>2013-06-17 12:31:02 +0200
committerGeorg Ehrke <georg@ownCloud.com>2013-06-17 12:31:02 +0200
commit1a933a91734be1057d54a6c24016b375bb4f36ed (patch)
tree2b0e8b113ca2da82448f9479933e646351aebc1a /lib/util.php
parent6082a0649cefd356370d4ca8034041c1af3875ff (diff)
parent6156d71832ee031d8d1f50d8dbff7d0bcfb45541 (diff)
downloadnextcloud-server-1a933a91734be1057d54a6c24016b375bb4f36ed.tar.gz
nextcloud-server-1a933a91734be1057d54a6c24016b375bb4f36ed.zip
Merge branch 'master' into oc_preview
Diffstat (limited to 'lib/util.php')
-rwxr-xr-xlib/util.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 95af22ed0ee..ddef0c63c55 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -833,6 +833,26 @@ class OC_Util {
}
/**
+ * 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);
+ }
+ }
+
+ /**
* Normalize a unicode string
* @param string $value a not normalized string
* @return bool|string