diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-08-18 11:34:56 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-08-18 11:34:56 +0200 |
commit | d8c71ba734d95e954d4ff3af50a44b94f9f016ff (patch) | |
tree | c89cd494a618e621f9c8941bac52bfed15dbad4c /lib/util.php | |
parent | 5c9aedac1b9e858e450ac0b1f009d8042206060b (diff) | |
parent | 12f4494de02457d51004ca6a82c1b2160189819f (diff) | |
download | nextcloud-server-d8c71ba734d95e954d4ff3af50a44b94f9f016ff.tar.gz nextcloud-server-d8c71ba734d95e954d4ff3af50a44b94f9f016ff.zip |
merge master in storage-wrapper-quota
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 4c878f8b2fe..7c610e5400d 100755 --- a/lib/util.php +++ b/lib/util.php @@ -188,6 +188,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(); @@ -329,6 +333,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; } @@ -891,6 +898,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(); + } } /** @@ -910,4 +921,11 @@ class OC_Util { return $value; } + + public static function basename($file) + { + $file = rtrim($file, '/'); + $t = explode('/', $file); + return array_pop($t); + } } |