From dab58f3464ec8aded5e0da4b050e5ee3d0bc5cfc Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Tue, 26 Jun 2012 20:53:28 +0200
Subject: [PATCH] Cache result of OC_App::getAppVersions

---
 lib/app.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/app.php b/lib/app.php
index be17beeacc5..a9feff1620a 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -567,6 +567,10 @@ class OC_App{
 	 * get the installed version of all papps
 	 */
 	public static function getAppVersions(){
+		static $versions;
+		if (isset($versions)) {   // simple cache, needs to be fixed
+			return $versions; // when function is used besides in checkUpgrade
+		}
 		$versions=array();
 		$query = OC_DB::prepare( 'SELECT appid, configvalue FROM *PREFIX*appconfig WHERE configkey = \'installed_version\'' );
 		$result = $query->execute();
-- 
GitLab