From bf09edcbf1775115067611b85b954fbabad74ba3 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Thu, 28 Jun 2012 21:54:33 +0200
Subject: [PATCH] Remember the app root information.

---
 lib/app.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/app.php b/lib/app.php
index 61566ed752..d1f12594a2 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -350,9 +350,13 @@ class OC_App{
 
 
 	protected static function findAppInDirectories($appid) {
+		static $app_dir = array();
+		if (isset($app_dir[$appid])) {
+			return $app_dir[$appid];
+		}
 		foreach(OC::$APPSROOTS as $dir) {
 			if(file_exists($dir['path'].'/'.$appid)) {
-				return $dir;
+				return $app_dir[$appid]=$dir;
 			}
 		}
 	}
-- 
GitLab