diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-17 13:15:22 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-17 13:15:22 +0200 |
commit | cabe92ef1240e171a812f5822ac69b4d7742fd71 (patch) | |
tree | 469e9089107d440da0c12c291abbd626d6d08b33 /lib/util.php | |
parent | 7adfc27cafa6f94962a33c158af9c45e71e012c5 (diff) | |
parent | d3e2f31adad5eeaf415154dd2fb88cb9fec0b3c1 (diff) | |
download | nextcloud-server-cabe92ef1240e171a812f5822ac69b4d7742fd71.tar.gz nextcloud-server-cabe92ef1240e171a812f5822ac69b4d7742fd71.zip |
Merge branch 'master' into decrypt_files_again
Conflicts:
apps/files_encryption/tests/keymanager.php
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index cc432af62af..d1752ecba0a 100755 --- a/lib/util.php +++ b/lib/util.php @@ -168,6 +168,10 @@ class OC_Util { * @return array arrays with error messages and hints */ public static function checkServer() { + // Assume that if checkServer() succeeded before in this session, then all is fine. + if(\OC::$session->exists('checkServer_suceeded') && \OC::$session->get('checkServer_suceeded')) + return array(); + $errors=array(); $defaults = new \OC_Defaults(); @@ -309,6 +313,9 @@ class OC_Util { 'hint'=>'Please ask your server administrator to restart the web server.'); } + // Cache the result of this function + \OC::$session->set('checkServer_suceeded', count($errors) == 0); + return $errors; } @@ -888,6 +895,10 @@ class OC_Util { if (function_exists('xcache_clear_cache')) { xcache_clear_cache(XC_TYPE_VAR, 0); } + // Opcache (PHP >= 5.5) + if (function_exists('opcache_reset')) { + opcache_reset(); + } } /** @@ -907,4 +918,11 @@ class OC_Util { return $value; } + + public static function basename($file) + { + $file = rtrim($file, '/'); + $t = explode('/', $file); + return array_pop($t); + } } |