summaryrefslogtreecommitdiffstats
path: root/lib/app.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/app.php')
-rwxr-xr-xlib/app.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/app.php b/lib/app.php
index 13b6617b23e..5883a29bb02 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -328,11 +328,23 @@ class OC_App{
*/
public static function getAppPath($appid) {
foreach(OC::$APPSROOTS as $dir) {
- if(file_exists($dir.'/'.$appid)) {
- return $dir.'/'.$appid;
+ if(file_exists($dir['path'].'/'.$appid)) {
+ return $dir['path'].'/'.$appid;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Get the path for the given app on the access
+ * If the app is defined in multiple directory, the first one is taken. (false if not found)
+ */
+ public static function getAppWebPath($appid) {
+ foreach(OC::$APPSROOTS as $dir) {
+ if(file_exists($dir['path'].'/'.$appid)) {
+ return $dir['web'].'/'.$appid;
}
}
-// OC_Log::write('core','Unable to find app "'.$appid.'"',OC_Log::ERROR);
return false;
}
@@ -477,9 +489,9 @@ class OC_App{
public static function getAllApps(){
$apps=array();
foreach(OC::$APPSROOTS as $apps_dir) {
- $dh=opendir($apps_dir);
+ $dh=opendir($apps_dir['path']);
while($file=readdir($dh)){
- if(substr($file,0,1)!='.' and is_file($apps_dir.'/'.$file.'/appinfo/app.php')){
+ if(substr($file,0,1)!='.' and is_file($apps_dir['path'].'/'.$file.'/appinfo/app.php')){
$apps[]=$file;
}
}