diff options
author | Brice Maron <brice@bmaron.net> | 2012-06-03 21:13:30 +0000 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2012-06-06 20:24:15 +0000 |
commit | cc494259d3e1fc60e82452dfdc1d0e0e0cd848e9 (patch) | |
tree | 5eb8dba209fc57625793487745d42515242fe1ee /lib/app.php | |
parent | 6832aec60fcdcc7e8b6433d8f9103cdf347f32ed (diff) | |
download | nextcloud-server-cc494259d3e1fc60e82452dfdc1d0e0e0cd848e9.tar.gz nextcloud-server-cc494259d3e1fc60e82452dfdc1d0e0e0cd848e9.zip |
Unit path and webpath, correct some more
Diffstat (limited to 'lib/app.php')
-rwxr-xr-x | lib/app.php | 22 |
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; } } |