summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Goetz <markus@woboq.com>2013-08-15 03:52:16 -0700
committerMarkus Goetz <markus@woboq.com>2013-08-15 03:52:16 -0700
commitb9f3bb24261961ead93fb76c1295066cfa666299 (patch)
tree76e16a25ec52f057448e926f5e3d720ea1ccaf2c
parent680ac48856a4fff2445f0be3707d846b46ae670c (diff)
parent3972198b61957ccefecd1a9840c9a46fb4e07ae9 (diff)
downloadnextcloud-server-b9f3bb24261961ead93fb76c1295066cfa666299.tar.gz
nextcloud-server-b9f3bb24261961ead93fb76c1295066cfa666299.zip
Merge pull request #4441 from guruz/checkServer_cache_result
Cache OC_Util::checkServer() result in session
-rwxr-xr-xlib/util.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index b7dc2207e6c..25632ac1ea2 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;
}